1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fiesta28 [93]
3 years ago
11

In a program you need to store identification numbers of 5 employees and their weekly gross pay.

Computers and Technology
1 answer:
Allushta [10]3 years ago
4 0

Solution :

a). The two arrays that are used in parallel in order to store the identification of two numbers of 5 employees and their weekly gross payments is  :

  int id_array[5];

  double gross_pay[5];

b). The loop that uses the arrays for printing the identification number and the weekly gross payment  is given below :

 for(int i=0; i<5; i++)

  {

  count <<id_array[i] <<" " << gross_pay[i] << end;

  }

You might be interested in
The Account class contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and a
melamori03 [73]

Answer:

I've updated the Account class as per the instructions. The instructions mention "the constructor for this class creates a random account number" although I didn't find where that was. As a result, I created a simple method to generates the account number (located at the bottom of the class). Be sure you understand the changes (highlighted in yellow) and feel free to ask follow-up questions:

Explanation:

//*******************************************************

// Account.java

//

// A bank account class with methods to deposit to, withdraw from,

// change the name on, and get a String representation

// of the account.

//*******************************************************

import java.util.Random;   // Used for Random # generator

public class Account

{

      private double balance;

  private String name;

     private long acctNum;

      //----------------------------------------------

 //Constructor -- initializes balance, owner, and account number

  //----------------------------------------------

 public Account(double initBal, String owner, long number)

{

        balance = initBal;

               name = owner;

            acctNum = number;

}

// !!!!!! New Constructor !!!!!!

public Account(double initBal, String owner)

     {

        balance = initBal;

               name = owner;

            acctNum = generateAccountNumber();

       }

  // !!!!!! New Constructor !!!!!!

 public Account(String owner)

     {

        balance = 0;

             name = owner;

            acctNum = generateAccountNumber();

       }

   //----------------------------------------------

 // Checks to see if balance is sufficient for withdrawal.

// If so, decrements balance by amount; if not, prints message.

  //----------------------------------------------

 public void withdraw(double amount)

      {

        if (balance >= amount)

                balance -= amount;

               else

                     System.out.println("Insufficient funds");

}

 // !!!!!! New withdraw() method !!!!!!

   public void withdraw(double amount, double fee)

  {

        double amountWithFee = amount + fee;

               if (balance >= amountWithFee)

                 balance -= amountWithFee;

        else

                     System.out.println("Insufficient funds");

}

   //----------------------------------------------

 // Adds deposit amount to balance.

       //----------------------------------------------

 public void deposit(double amount)

       {

        balance += amount;

       }

  //----------------------------------------------

 // Returns balance.

      //----------------------------------------------

 public double getBalance()

       {

        return balance;

  }

    //----------------------------------------------

 // Returns a string containing the name, account number, and balance.

    //----------------------------------------------

 public String toString()

 {

        return "Name:" + name +

          "\nAccount Number: " + acctNum +

         "\nBalance: " + balance;

 }

 // !!!! NEW PRIVATE HELPER METHOD TO GENERATE ACCOUNT NUMBERS !!!!!

//-------------------------------------------------------

// Returns a random account number between 10000 - 99999

 //--------------------------------------------------------

       private long generateAccountNumber()

     {

        Random r = new Random();        // Seed the random number genertor with the system time

         return 10000 + r.nextInt(89999);        // .nextInt(89999) will return a value between 0 and 89999)

      }

}

8 0
4 years ago
When looking at security standard and compliance, which three (3) are characteristics of best practices, baselines and framework
Brilliant_brown [7]

Answer:

In order to observe best practices, and to meet with technical and other requirements, organizations often use frameworks for cybersecurity compliance and regulatory compliance. These frameworks provide best practices and guidelines to assist in improving security, optimizing business processes, meeting regulatory requirements, and performing other tasks necessary to achieve specific business objectives such as breaking into a particular market niche or selling to government agencies.

Many such frameworks exist, and the recommendations set out in them can impose difficult and often expensive demands on enterprise resources – especially in situations where an organization is subject to a number of regulatory compliance regimes, whose requirements it has to meet while maintaining its own strong cybersecurity status.

Explanation:

4 0
3 years ago
For this programming assignment you will implement the Naive Bayes algorithm from scratch and the functions to evaluate it with
DanielleElmas [232]

Bayes’ Theorem provides a way that we can calculate the probability of a piece of data belonging to a given class, given our prior knowledge.

P(class|data) = (P(data|class) * P(class)) / P(data)

Where P(class|data) is the probability of class given the provided data.

Explanation:

  • Naive Bayes is a classification algorithm for binary  and multiclass classification problems.
  • It is called Naive Bayes or idiot Bayes because the calculations of the probabilities for each class are simplified to make their calculations tractable.

This Naive Bayes tutorial is broken down into 5 parts:

Step 1: Separate By Class :  Calculate the probability of data by the class they belong to, the so-called base rate. Separate our training data by class.

Step 2: Summarize Dataset : The two statistics we require from a given dataset are the mean and the standard deviation

The mean is the average value and can be calculated using :

mean = sum(x)/n * count(x)

Step 3: Summarize Data By Class : Statistics from our training dataset organized by class.

Step 4: Gaussian Probability Density Function : Probability or likelihood of observing a given real-value. One way we can do this is to assume that the values are drawn from a distribution, such as a bell curve or Gaussian distribution.

Step 5: Class Probabilities :  The statistics calculated from our training data to calculate probabilities for new data.  Probabilities are calculated separately for each class. This means that we first calculate the probability that a new piece of data belongs to the first class, then calculate the second class, on for all the classes.

8 0
4 years ago
Designing a video game takes tons of creativity. What inspires your personal creativity and ideas for video games? Explain and g
Whitepunk [10]

Answer:

This is what I have so far

Designing a video game takes tons of creativity. What inspires your personal creativity and ideas for video games? Explain and give several specific examples. How do you make sure your ideas are original and not copied directly from other video games? Explain.

What inspires my personal creativity is all the indie games I have played in the past, and they have always amazed me with their design, video games have always been a part of me from the Mario games I played when I was little to AAA titles. My ideas are original because I’ve seen so much, that I know when something is unique and original.

Explain how the four-game mechanics mentioned in the unit (reward, risk/loss, levels, and feedback) could work together to create an interesting sports video game.

Every 10 levels is a new sport and each level is harder, but at the end of each level you earn money to buy better gear, (like a system from simple rpg,) but if you lose, you also lose money. Also, you would need to use feedback that you would get from players to improve the game.

You’ve learned that video games use rewards to keep players coming back for more. Can you think of an example in real life that uses rewards to keep people coming back for more? How is this similar to video game rewards? Explain.

When a person works 1 job for many years, they may get burnt out, but if they get a raise or a promotion every once and awhile, then they will be more motivated and come back for more. This is similar to games in a few ways, like if you play a single game for years, it will get boring, but if that game receives an update, then it will motivate people to play.

7 0
3 years ago
Critical thinking questions Giving 30 points if you answer correctly!!!!
krek1111 [17]

Answer:

1. The reason hunting seasons are displayed all over the world in cave paintings is because of the necessity to hunt. Ancient people everywhere were nomads that relied on wild animals for the majority of their calories. The paintings likely served as an expression of the importance of hunting to their culture. It could have also been used as educational material for very young children to learn about hunting as well as its importance to their community.

Explanation:

I can't do 2nd because the image was cut off, sorry.

8 0
3 years ago
Other questions:
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • 1. What is the global marketplace?
    11·2 answers
  • SP 800-14, Generally Accepted Principles and Practices for Securing Information Technology Systems, provides best practices and
    12·1 answer
  • How many bits must be "flipped" (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase that’s represented
    13·2 answers
  • Kindly answer in Just 7,8 lines please
    7·1 answer
  • Please help I’ll give you 10 points
    8·2 answers
  • Software companies will often release a(n) ___ version to a limited audience that will test it on their systems. Programmers can
    11·1 answer
  • 20 points!!
    7·1 answer
  • (python) Given the formula for conversion from Celsius to Fahrenheit
    10·1 answer
  • An L2 cache with 64-byte lines, 4 ways, and 4096 sets, for a machine with 40-bit physical addresses. How many bits of an address
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!