answer.
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]
2 years ago
6

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

Computers and Technology
1 answer:
Eva8 [605]2 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
In Linux, the most popular remote access tool is OpenSSH. Which software performs the same remote command line (CLI) access from
maxonik [38]

Answer:

Putty

Explanation:

PuTTY is an SSH and telnet client for Windows and Unix platform. PuTTY is an open source terminal emulator, serial console and network file transfer application. It does not only support SSH and telnet, it also supports other network protocols like SCP, rlogin, and raw socket connection.

To make use of the SSH client on windows, you need to first download and then install the PuTTY software.

6 0
2 years ago
Kelli is unable to find a shape that meets her needs which feature in PowerPoint should she use to create shapes that are comple
sergij07 [2.7K]

In order to customize a shape, Kelli should first add a basic shape and select it. After that, she needs to access the format tab where she can find the option to edit the selected shape. She can modify the selected shape or change it to a free-form according to her needs.

<u>Explanation:</u>

Microsoft PowerPoint provides an easy way for customizing the shapes according to the needs of the user.

Although PowerPoint provides many basic shapes that suit the need of most of the users but in exceptional cases, changes are always welcome. So in order to customize a shape, she should follow the steps which has been explained above.

5 0
2 years ago
The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
Iteru [2.4K]

Answer:

The answer is True

6 0
2 years ago
Which data table display compares report metrics to the website average?
lozanna [386]
The appropriate response is Pivot. Correlation shows a bar graph plotting the execution of the chose measurements in respect to the site normal. Turn tables are not made naturally. A rotate table enables you to separate the essentialness from a vast, point by point dataset.
3 0
2 years ago
On her way home from work, elena saw an expensive designer purse she just had to have. Five minutes later, she was taking a self
Basile [38]
2.syndrome E is the correct answer
3 0
2 years ago
Other questions:
  • What are the two most important network-layer functions in a datagram network? what are the three most important network-layer f
    7·1 answer
  • George and Miguel are considering opening up a shoe store but first need to do market research. Which one of these is NOT part o
    13·2 answers
  • The bit width of the LRU counter for a 32 KB 16-way set associative cache with 32 Byte line size is
    13·1 answer
  • Why would someone need to use tools like IECacheView or MyLastSearch on a system? Do companies have the right to search a workst
    11·1 answer
  • Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursive (Algorithm 2.1).
    11·1 answer
  • Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message
    14·1 answer
  • Write a recursive, string-valued method, replace, that accepts a string and returns a new string consisting of the original stri
    14·1 answer
  • A security analyst is interested in setting up an IDS to monitor the company network. The analyst has been told there can be no
    15·1 answer
  • Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *thi
    7·1 answer
  • The height of a small rocket y can be calculated as a function of time after blastoff with the following piecewise function: y 5
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!