/* Wages.java * Computes the taxes and wages for an employee given the * number of hours worked and their pay rate. */ import java.util.*; public class Wages { public static void main( String[] args ) { // Set tax rates as constants. final double STATE_TAX_RATE = 0.035; final double FED_TAX_RATE = 0.15; double hours, payRate; double wages, stateTaxes, fedTaxes, takeHome; String employee; Scanner keyboard = new Scanner( System.in ); // Extract data from the user. System.out.print( "Employee name: " ); employee = keyboard.next(); System.out.print( "Hours worked: " ); hours = keyboard.nextDouble(); System.out.print( "Pay rate: " ); payRate = keyboard.nextDouble(); // Compute the employee's taxes and wages. wages = hours * payRate; stateTaxes = wages * STATE_TAX_RATE; fedTaxes = wages * FED_TAX_RATE; takeHome = wages - stateTaxes - fedTaxes; // Print the results. System.out.println( "PAY REPORT" ); System.out.println( "Employee: " + employee ); System.out.println( "----------------------------------" ); System.out.println( "Wages: " + wages ); System.out.println( "State Taxes: " + stateTaxes ); System.out.println( "Fed Taxes: " + fedTaxes ); System.out.println( "Pay: " + takeHome ); } }