Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that will calculate the gross pay for Steel Millworkers. Any num

ID: 3611016 • Letter: W

Question

Write a program that will calculate the gross pay for Steel Millworkers. Any number of workers may enter their payrate and hours worked (must be a positive number and cannot be morethan 60) and see their gross pay displayed to the screen. Use afunction to calculate and display the gross pay. Be sure toinclude the pseudocode for the problem in your header with yourname and class information.

Explanation / Answer

/* pseudocode: 1) we will prompt whether Anybody will like to calcualte grosspay 2) if Yes then ask for pay rate and number of hrs 3) if hours is greater than 60 aks the user to enter number ofhours again 4) call teh fucntion grosspay() to calcualte the gross payvalue 5) prompt whether anybody else like to calculate the grosspayvalue */ import java.io.*; public class Gross{ public static double grossPay(double payRate, int numHrs) {    double gross=0.0;    gross= (payRate * numHrs);    return gross; } public static void main(String[] args){ String s=""; double payrate=0.0; int hours=0; double gross=0.0; do {    try    {        System.out.print("Do u liketo know the Gross Pay (Enter Y or N): ");        s =(new BufferedReader(newInputStreamReader(System.in)).readLine());        if( (s.equals("Y")) || (s.equals("y")))        {            System.out.print("Enter the pay rate : ");            payrate =Double.parseDouble(new BufferedReader(newInputStreamReader(System.in)).readLine());            System.out.println();            do            {               System.out.print("Enter the number ofhours (less than or equal to 60 ) : ");               hours = Integer.parseInt(newBufferedReader(new InputStreamReader(System.in)).readLine());               System.out.println();            }            while(hours >60);                       gross =grossPay(payrate, hours);            System.out.println("Gross Pay is: " +gross);        }    }       catch(Exception e)    {        e.printStackTrace();    } }//end of do while(! ( (s.equals("N")) ||   (s.equals("n"))));            }//end of main }//end of Gross class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote