Question Details

Answered: - Design a Payroll class with the following fields: name :


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 assignvalues? 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.

____________________________________________________________________________

Sample Run:

Enter?employee's?name:Hermione?Granger? Enter?employee's?ID?number:107548? Enter?hourly?rate:100.5? Enter?number?of?hours?worked:45? Hermione?Granger,?employee?number?107548,?made?$4522.50?in?gross?pay.?

class payRoll

 

{

 

String name;

 

int idNumber;

 

double rate;

 

int hours;

 

payRoll(String NAME, int ID)

 

{

 

name=NAME;

 

idNumber=ID;

 

}

 

public String getName()

 

{

 

return name;

 

}

 

public int getIdNumber()

 

{...

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 18, 2020

PRICE: $15

Solution~0001185294.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 18, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now