Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COP-ss50- HW4: Another look at HWif In Java, Implensent a simple weelly payroll program. The input will conato of the employee's fall name, employee's ID

image text in transcribed
image text in transcribed
COP-ss50- HW4: Another look at HWif In Java, Implensent a simple weelly payroll program. The input will conato of the employee's fall name, employee's ID (a string), the number of hours worked (a real number), the hocily. rate (a real number), the income tax is 6x. Your program should calculate the fotal gross pay, and the net pay and dieplay a paychock like Your program anust include the clas Employee whose private attributes are - fullName: String - employeeNumber String - payRate double - hourwhorked double In addition to that, equip the class Employee with these methods: - Employee (String fallName, String employceNumber, double payRate, double hours Worked) The constructor that assigns the passed parametres fullName, enployeeNuraber, payrate, hours Worked to the data members. - For cach of the grivate data menhers above, add the Setters and the Getters - Override the toString0) method to return the String of the form. [Fmployee Number/Full Name, x Hours \& y per heur] where x is the namber of hours worked and y is the poy rate. An an example, [js/woo/John Smith, se Hours (4 10.5 per hour] - dooble netRay (h the private miethod that retarna the net guy of ahe eeployee. - void princhicck 0 , the method that grints the puycheck of the ef ployee as shown above. The princChock netbod cally the prinate netPay mothed so get the net pay of the cenpleger. All students must use this Main.java //HN4 //Your Name goes Here public class Main \{ public static void main(String[] args) \{ String fullName = "Erika T. Jones"; String employeeNumber = "ej789"; double payRate =100., hoursworked =1.0; I/TA will change the payrate and the hours worked to test your code Employee e; e = new Employee (fullName, employeeNumber,payRate, hoursWorked); System.out.println(e); //To Test your tostring method e.printcheck(); //This prints the check of Erika T. Jones System.out,println("Byel"); \} 3 11 class Employeef b //Your code goes here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions