/* Java program to compute an employee's gross and net pay for a week. ** A fixed percentage of gross pay is deducted for taxes. ** There is no consideration given to overtime pay. ** Input is simulated using assignment statements ** (i.e., the input values are "hard-coded" within the program). ** The lone method is main(); hence, there is no evidence of ** procedural decomposition having been used in this program's design. ** ** Author: R. McCloskey ** Date: Sept. 2023 */ public class GrossNetPay0 { public static void main(String[] args) { final double TAX_RATE = 0.1825; // symbolic constant double hoursWorked, hourlyWage; // inputs, in a sense double grossPay, netPay; // outputs double tax; // auxiliary variable hoursWorked = 42.8; // In a contrived fashion, assign values hourlyWage = 14.58; // to the input variables. // compute gross pay and store it in the relevant variable grossPay = hoursWorked * hourlyWage; // compute the tax and store it in the relevant variable tax = grossPay * TAX_RATE; // compute net pay store it in the relevant variable netPay = grossPay - tax; // report the results System.out.println(hoursWorked + " hours worked at $" + hourlyWage + " per hour"); System.out.println("yields gross pay of $" + grossPay + "\nand net pay of $" + netPay); } }