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
aivan3 [116]
4 years ago
6

Employees at a store are paid daily wages according to the following rules.

Computers and Technology
1 answer:
Eva8 [605]4 years ago
4 0

Answer:

See explaination

Explanation:

public class Payroll

{

private int[] itemsSold;

private double[] wages;

//constructor is just kept for demonstrating the code output

public Payroll()

{

itemsSold = new int[] {48,50,37,62,38,70,55,37,64,60};

wages = new double[10];

}

/*

to compute Bonus Threshold, you have to find sum Of Items Sold, highest and lowest

deduct highest and lowest from sum Of Items Sold and then divide by number of items -2

to find the bonus Threshold

*/

public double computeBonusThreshold()

{

int highest = itemsSold[0];

int lowest = itemsSold[0];

int sumOfItemsSold = itemsSold[0];

double bonusThreshold =0;

//iterate over items , find sum of items sold and highest and lowest

for (int i = 1; i < itemsSold.length ; i++)

{

sumOfItemsSold += itemsSold[i];

if(itemsSold[i] > highest)

highest = itemsSold[i];

if(itemsSold[i] < lowest )

lowest = itemsSold[i];

}

bonusThreshold = (sumOfItemsSold - lowest - highest ) / (itemsSold.length -2.0);

return bonusThreshold;

}

/*

Compute wages as asked, wage for an employee is fixed wage added with itemSold * perItemWage

When an employee sold items more than bonus Threshold Items then he will get extra 10%

*/

public void computeWages(double fixedWage, double perItemWage)

{

double bonusThresholdForWages = computeBonusThreshold();

for (int i = 0; i < wages.length ; i++)

{

wages[i] = fixedWage + ( itemsSold[i] * perItemWage);

if(itemsSold[i] > bonusThresholdForWages)

{

wages[i] = wages[i] * 1.1 ; //which is 10 % extra of current wage of employee

}

}

}

/*

Method to show itemsold, wages for the employee

*/

public void printWages()

{

for (int i = 0; i < wages.length ; i++)

{

System.out.printf("Employee =%d , ItemsSold = %d, Wage = %.2f\n",i,itemsSold[i], wages[i]);

}

}

}

=========main.java======

public class Main

{

public static void main(String[] args) {

//create an object of payroll class, where itemsSolds are hard coded for demo

Payroll payroll = new Payroll();

System.out.println("Bonus threshold items are : " + payroll.computeBonusThreshold());

//call computeWages which will internally class bonus threshold as well

payroll.computeWages(10.0,1.5);

payroll.printWages();

}

}

See attachment for screenshot of codes for indentation.

You might be interested in
After a business transaction has been analyzed, which of the following must occur for the analysis to have been done correctly?
ICE Princess25 [194]

Answer:

A. Equity must equal the difference between assets and liabilities.

Explanation:

Assets are things a company or business owns while liabilities are things person or company owes.

Thus, Equity is the difference between the assets and the liabilities.

So, option A which is <u>Equity must equal the difference between assets and liabilities</u> is the answer.

5 0
3 years ago
After several configuration changes are made to a router, the copy running-configuration startup-configuration command is issued
adoni [48]

Answer: NVRAM(Non-volatile random-access memory)

Explanation:Non-volatile random-access memory(NVRAM) is the memory that has a non-volatile nature.It is used for retaining of the data even when the system gets switched off .

This memory uses the power source from the CMOS battery for executing the functions. It is designed by using the pin configurations containing 24 pin in DIP(Dual inline package). So the situation mentioned in the question of storing the changes will appear in the NVRAM.

4 0
4 years ago
During the software planning process, Rick, a project manager, finds that his team has made an incorrect estimation of funds. Wh
allochka39001 [22]

Answer:

Rick has identified a cost risk.

Explanation:

Risk is the probability of loss in a given setting. Herein, the risk involved is the inadequate assessment of the costs involved to carry out the project usually as a result of poor pricing evaluation of resources required for the project. At the early stage of every project, effective and efficient cost estimation is needed because it provides a basis for estimation of the total costs, it helps distribute the cost budget, it eases decision making and thereby assuring a level of profitability, everything being equal.

7 0
3 years ago
Read 2 more answers
Switches: Select one:
const2013 [10]

Answer:

b. connect two or more network segments that use different data link protocols

Explanation:

A switch is an analog device that allows to interconnect networks, it is possibly one of the devices with a higher level of scalability. It is important to clarify that a Switch does not only provide connectivity with other networks, nor does it provide connectivity with the Internet, for this purpose a router is necessary.  

6 0
4 years ago
Alexis has six different pieces of jewelry to show and describe
Pachacha [2.7K]

Answer:

The answer to this question is given below in the explanation section

Explanation:

This question is not complete and the completed question is given below:

Alexis has six different pieces of jewelry to show and describe on a web page. Two are gold, and the rest are silver. Based on the principles of proximity, how would she display these pieces on her page?

  1. She would separate each and provide some distance between
  2. them
  3. She would mix the pieces and keep them all close together
  4. She would make two columns of jewelry with an equal number of  pieces in each
  5. She would group the gold together, and the silver together

Based on the principle of proximity, the correct answer to this question is:

She would group the gold together, and the silver together.

As you know that the principle of proximity states that things that are close together appear to be more related than things that are spaced farther apart. So based on this principle she needs to make two groups gold and silver. So, based on the proximity principle, she would group the gold together, and the silver together.  

4 0
3 years ago
Other questions:
  • How many results are shown by default when using a Top or Rare Command?
    13·1 answer
  • A medical assistant at a local hospital is exploring the Start Menu of his/her computer and various Windows programs/application
    6·1 answer
  • What is the rationale behind the development of an operating system in computing?
    15·1 answer
  • Discuss why it is common for XML to be used in interchanging data over the Internet. What are the advantages of using XML in dat
    7·1 answer
  • JAVA
    14·1 answer
  • Jerry is working at the desk of a client in the marketing department of his company. The client thinks that the problem is the v
    5·1 answer
  • 2- (8 point) Write a program using the instructions below. Assume that integers are stored in 4 bytes. a) Define an array of typ
    10·1 answer
  • What is payload?
    8·1 answer
  • Read the following scenario:
    10·2 answers
  • Why linked list is better than an array?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!