SE491 week 3 assignment

profileUnknownp

import java.util.*;

 public class Payroll

{

 public static void main(String args[])

 {

 String lastName;

 double hours, netPay, grossPay;

 double STD_PAYRATE = 15.50;

 double WITHHOLDING_RATE = 0.20;

 System.out.println("Enter employee last name: ");

 Scanner input = new Scanner (System.in);

 lastName = input.nextLine();

 System.out.println("Enter hours worked for  " + lastName +" >> ");

 hours = input.nextDouble();

 grossPay = hours * STD_PAYRATE;

 netPay = grossPay - (grossPay * WITHHOLDING_RATE);

 System.out.println("Net pay for " + lastName + " who worked for " + 

 hours + " hours is $" + String.format("%.2f",netPay));

 }

}

  • 5 years ago
  • 10
Answer(1)

Purchase the answer to view it

blurred-text
NOT RATED
  • attachment
    Question1Code.docx
  • attachment
    Question1.docx
  • attachment
    ScreenShotQuestion2.docx