Question: 1 Create two files to submit: Payroll.java - Class definition PayrollClient.java - Contains main() method Build the Payroll class with the following specifications: 4 private

1 Create two files to submit:

Payroll.java - Class definition

PayrollClient.java - Contains main() method

Build the Payroll class with the following specifications:

4 private fields

String name - Initialized in default constructor to "John"

int ID - Initialized in default constructor to 9999

doulbe payRate - Initialized in default constructor to 15.0

doulbe hrWorked - Initialized in default constructor to 40

2 constructors (public)

Default constructor

A constructor that accepts the employees name, ID, and pay rate as arguments. These values should be assigned to the objects name, ID, and payRate fields.

7 public member methods (mutators, accessors, and other)

getName()

getID()

setPayRate() & getPayRate()

setHrWorked() & getHrWorked()

A method named grossPay that returns employees gross pay (=hrWorked * payRate)

(2) In main(), create two Payroll objects: one use the info inputted by the user, and the other use the default constructor, and print the info for each employee Ex:

Enter the name, ID, pay rate, and hours worked of an employee: Linda Smith 1234 20.5 35 Employee Records: Name ID Pay Rate Hrs Worked Gross Pay Linda Smith 1234 $20.50/hr 35.0 $717.50 John Doe 9999 $15.00/hr 40.0 $600.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!