Computers and Technology

Design a Payroll class with the following fields: β€’ name: a String containing the employee's name
β€’ idNumber: an int representing the employee's ID number
β€’ rate: a double containing the employee's hourly pay rate
β€’ hours: an int representing the number of hours this employee has worked

The class should also have the following methods:

β€’ Constructor: takes the employee's name and ID number as arguments
β€’ Accessors: allow access to all of the fields of the Payroll class
β€’ Mutators: let the user assign values to the fields of the Payroll class
β€’ grossPay: returns the employee's gross pay, which is calculated as the number of
hours worked times the hourly pay rate.

Write another program that demonstrates the class by creating a Payroll object, then
asking the user to enter the data for an employee in the order: name, ID number, rate, hours.
The program should then print out a statement in the following format (for example, if
you had an employee named Chris Jacobsen with ID number 11111, who works for 5 hours at
$10/hr):

Chris Jacobsen, employee number 11111, made $50.00 in gross pay.

Using text forming so that the gross pay is rounded to two decimal places.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
image
Computers and Technology, 23.06.2019 20:30, maryanapritchak1829
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
image
Computers and Technology, 24.06.2019 02:10, ttangelique
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
image
Computers and Technology, 24.06.2019 09:00, lisacarter0804
Why might you chose to crest a function resume
Answers: 1
Do you know the correct answer?
Design a Payroll class with the following fields: β€’ name: a String containing the employee's name

Questions in other subjects:

Konu
Mathematics, 05.10.2019 16:30
Konu
History, 05.10.2019 16:30