Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Your neighbor\'s teenage son currently cuts your yard every 10 days. Your beauti

ID: 3668320 • Letter: Y

Question

Your neighbor's teenage son currently cuts your yard every 10 days. Your beautiful front yard is a perfect rectangle, with the street measurement being 48 feet and the driveway side being 32 feet. Your current cost to have it fully cut and manicured is $50.50 every 10 days. A new lawn service will do the same job for $0.30 per square yard, with an 8% discount, if you agree to allow them to do your yard for nine consecutive times.

The assignment asks for a Java program that can determine which one is the best deal, like a calculator. You’ll need to write a code where you can enter values like cost, area, and it will give you the cost per yard.

Explanation / Answer

import javax.swing.JOptionPane; public class PayrollCalculatorStep1 { public static void main(String[] args) { int hoursWorked; double payRate; double grossPay; double fwt; double fica; double netPay; double totalHoldings; String name = " "; String inputValue; char first; final double FWT_RATE = .20; final double FICA_RATE = .08; name = JOptionPane.showInputDialog("Enter name"); inputValue = JOptionPane.showInputDialog("Enter Hours Worked:"); hoursWorked = Integer.parseInt(inputValue); inputValue = JOptionPane.showInputDialog("Enter Pay Rate:"); payRate = Double.parseDouble(inputValue); grossPay = hoursWorked * payRate; fwt = grossPay * FWT_RATE; fica = grossPay * FICA_RATE; totalHoldings = fwt + fica; netPay = grossPay - totalHoldings; JOptionPane.showMessageDialog(null, "Employee Name: " + name + " Gross Pay:" + grossPay + " Net Pay: " + netPay); System.exit(0); } }