Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

using java;

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 Doe"

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) (8 pts)

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

image text in transcribed

14.9 pro9_obj&Class(payroll) (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 o String name-Initialized in default constructor to John Doe o int ID - Initialized in default constructor to 9999 o doulbe payRate Initialized in default constructor to 15.0 o doulbe hrWorked - Initialized in default constructor to 40 2 constructors (public) o Default constructor o A constructor that accepts the employee's name, ID, and pay ate as arguments. These values should be assigned to the objects name, ID, and payRate fields. 7 public member methods (mutators, accessors, and other) (8 pts) o get DO o setHrWorked0 & getHrWorked0 o A method named grossPay that returns employee's gross pay (-hrWorked payRate) (2) In main0, 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 (2 pts) Ex: En name ID.p pay rate, and hours worked of an employee ter the Linda Smith 1234 20.5 35 Employee Name Lind? 3mith John Doe Pay Rate 20.50/hr $15.00/hr Hrs Worked 35.0 40.0 ID Gross Pay 1234 $717.50 600.00

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

Why are coal, oil, and natural gas called fossil fuels?

Answered: 1 week ago

Question

=+Who are you right now, and where do you want to be?

Answered: 1 week ago