Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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)

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

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

What types of interferences are encountered in ICPMS?

Answered: 1 week ago