Question: Write a java program that calculates the weekly pay for a group of employees. Your program should do the following: Declare the following 4 parallel

Write a java program that calculates the weekly pay for a group of employees. Your program should do the following:

Declare the following 4 parallel arrays, size 4.

Names (String)

hoursWorked (double)

hourlyPay (double)

WeeklyEarnings (double)

Use a for loop to prompt for the names, hours worked and hourly pay for the 4 employees.

Example Output:

Please enter name #1: John

Please enter the number of hours worked: 10

Please enter the hourly pay rate: 12.50

Please enter name #2: Jane

Please enter the number of hours worked: 20

Please enter the hourly pay rate: 15.50

Use a for loop to calculate the total earnings for each employee and store the results in the WeeklyEarnings array.

Use a for loop to display the results as follows:

Name Hours Worked Hourly Pay Weekly Earnings

------------------- -------------------------------------

John 10 $12.50 $125.00

Jane 20 $15.50 $310.00

Mike 15 $10.00 $300.00

Carol 30 $13.00 $390.00

Extra Credit(5 points):

Use methods to complete steps 2,3 and 4. Use the following method headers:

GetInfo(String[], double[], double[]): void

CalculateTotal(double[], double[]): double

DisplayInfo(String[], double[], double[], double[]): void

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!