SE491 week 3 assignment
March 8th, 2022
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));
}
}