Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // * * * * * * * * * * * * * * * * * * * * * * * * *
- // This program determines gross pay for a company's
- // employees.
- // Inputs: hoursWorked, rate
- // Outputs: grossPay
- // Written by: J Chuhaloff
- // Last Modified: Oct 2, 2012
- // * * * * * * * * * * * * * * * * * * * * * * * * *
- import java.util.Scanner;
- public class HW6 {
- public static void main (String[] args) {
- int hoursWorked;
- double rate;
- double grossPay;
- Scanner stdin = new Scanner(System.in);
- ;
- System.out.print("\nEnter the rate of pay: ");
- rate = stdin.nextDouble();
- System.out.print("\nEnter the number of hours worked: ");
- hoursWorked = stdin.nextInt();
- if (rate <= 40) {
- rate = rate * 1.0;
- System.out.print(rate * hoursWorked);
- }
- else {
- rate = rate * 1.5;
- System.out.print(rate * hoursWorked);
- }
- while (hoursWorked != -1); {
- System.out.print("\nGross Pay: ");
- System.out.print(grossPay = rate * hoursWorked);
- }
- }
- }
Add Comment
Please, Sign In to add comment