The Artima Developer Community
Sponsored Link

Java Answers Forum
java

2 replies on 1 page. Most recent reply: Nov 6, 2007 6:53 AM by Doug Gunnoe

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
amar akbar

Posts: 1
Nickname: amar698969
Registered: Nov, 2007

java Posted: Nov 4, 2007 4:19 PM
Reply to this message Reply
Advertisement
create a class using java that calculates and displays the gross and net pay of an employee based on the data entered by the user
when you are designing class ensure you address the following points
1.name the class EmployeePayroll
2.the class is to include a default constructor to record the employee's first name, lastname, id, hours worked, hourly pay rate, gross pay, and net pay
3.the class is to include a default constructer used to initialise the fields for first name, lastname, and ID to empty strings; hours worked and pay rate to zero.
4.the class is to include a second constructor that accepts vaules fpr the firstname, last name , ID, hours worked , and pay rate and initialises their corresponding fields vaules accordingly .
5.each field should have its own getter method that returns its value.
6.setter methods are required to the firstname, lastname, ID, hours worked, and pay rate fields.
7. seperate methods are necessary to calculate gross pay and net pay using the supplied formulas. neither of these methods returns a value.
8.a method is required to display an employee's payslip, containing all their detials including gross and net pay. this method should call on the appropriate getter methods to access the employee's detials.
9.tax rate is a fix value of 42%(0.42)
10. use appropiate code comments

formulas
1.for employees who have worked upto 38 hours
gross pay = hours worked * pay rate

2.for employees who have worked upto 42 hours
gross pay = 38 * pay rate (hours worked - 38) * 1.5 * pay rate

3.for employees who have worked upto 60 hours
gross pay = 38 * pay rate + 4 * 1.5* pay rate + (hours worked - 42) * 2 * pay rate

4. net pay = gross pay - (gross pay * tax rate )


Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: java Posted: Nov 5, 2007 3:28 AM
Reply to this message Reply
And your problem is?

Doug Gunnoe

Posts: 22
Nickname: dgun
Registered: May, 2007

Re: java Posted: Nov 6, 2007 6:53 AM
Reply to this message Reply
"And your problem is?"

His problem is that he does not want to do his homework.

The only way to learn this stuff is to do it. If you don't like it, study something other than computer science.

But if you have a specific question, please ask it.

Flat View: This topic has 2 replies on 1 page
Topic: java Previous Topic   Next Topic Topic: Trouble sorting a linked list....

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use