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

Can you delcare constant Write the Program logic that will compute the paycheck

ID: 441653 • Letter: C

Question


Can you delcare constant

Write the Program logic that will compute the paycheck of an employee. This is as much an exercise in designing your logic as much as a programming exercise in the grammar and syntax. Your program's logic will perform a user to perform the following: Enter the employee's LAST Name Enter the employee's FIRST Name Enter the employee's ID Number Enter the employee's Total Hours Worked up to a maximum of 60 hours Enter the employee's Pay Per Hour. The Pay per hour cannot be than $100.00 per hour. It cannot be less than the minimum wage (i.e.$8.50 per hour). Detect any erroneous pay rate and set it to a default. If less than the minimum hourly wage, set to the minimum hourly wage. If greater than the maximum rate then set that employee to the maximum rate. Display an appropriate "error message" telling that data entry clerk what they did. Federal tax rate and State tax rate from zero to 40%. State and Federal tax rates cannot exceed a combined 80%. Calculations include: Compute the Regular Pay (any hours up to 40 hours

Explanation / Answer

import java.io.*; public class payment { public static void main(String args[]) throws IOException { DataInputStream dis = new DataInputStream(System.in); System.out.println("Enter your last name: "); String last = dis.readLine(); System.out.println("Enter your first name: "); String first = dis.readLine(); System.out.println("Enter your ID: "); String ID = dis.readLine(); System.out.println("Enter your total work hrs: "); Double hr = Double.parseDouble(dis.readLine()); if(hr>60){System.out.println("Total Hours can not be more than 60hrs"); System.out.println("Enter your total work hrs: "); hr = Double.parseDouble(dis.readLine());} System.out.println("Enter pay per hrs rate: "); Double rate = Double.parseDouble(dis.readLine()); if(rate>100){System.out.println("Rate per hr. not correct"); rate = 100.00;} if(rate80)System.out.println("Wrong tax rate enterd"); Double rpay; Double otime=0.0; if(hr
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote