Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


madguy
Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque.
2 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners


Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque. Design your class based on the UML diagram to the right as well as the following notes:

A static field, empCount, keeps track of the number of instantiated employees and can be retrieved using the static method getCount( )
The constructor initializes the employee's name and employee number (a random number in the range of 1000 - 9999)
The method setEmployeePay( ) is overloaded to accomodate different payment methods based on empType:

    Type 1 - Salaried employees have a yearly salary, paid on a weekly basis
    Type 2 - Hourly employees are paid an hourly rate for the number of hours worked (overtime is time and a half for hours over 40)
    Type 3 - Piece employees are paid a base amount plus $24.00 for every piece completed
The method calculatePay( )will determine what the employee's weekly pay is, based on their payment type
The methods getName( ) and getNumber( )return the employee's name and employee number respectively
All input & output should be displayed in the main class only


The main program should test your class by instantiating four different employees:

    Test a salaried employee
    Test two hourly employees, one who has worked overtime and one who hasn't
    Test a piecework employee
    The following data can be hard-coded into your program (no prompts to enter data other than the names):

        Employee 1: (22.50, 35.0)
        Employee 2: (45350.00)
        Employee 3: (500.00, 25)
        Employee 4: (14.75, 48.0)

Output: 
Enter an employee name: Bob 

Employee Count is: 1

Enter an employee name: Ted

Employee Count is: 2

Enter an employee name: Carol

Employee Count is: 3

Enter an employee name: Alice

Employee Count is: 4

Employee  8826  Bob earned $787.50

Employee  5454  Ted earned $872.12

Employee  1083  Carol earned $1100.00

Employee  8782 Alice earned $767.00

Advertisement
View Answers

July 1, 2012 at 5:08 AM


using these names



July 1, 2012 at 5:09 AM


click on above line "using these names"



Related Tutorials/Questions & Answers:
Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque.
Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque.  Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque. Design
to write a program to display the employee details..
to write a program to display the employee details..  To dipslay the employee details like empid,empname,salary,wonno bye using java swings.by running this program the new window has to be opened asking us to enter all
Advertisements
program on employee details
program on employee details  to write a program on displaying the employee details like empid,empname,wonno,location,leave type by using the text fields in java swings
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
How do I write a program to manage an employee's business and personal contacts?
How do I write a program to manage an employee's business and personal contacts.... Demonstrate use of polymorphism by overriding a method of the abstract class in both... Requirements 1. Demonstrate use of collections (e.g., TreeSets, ArrayList). 2
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
EMPLOYEE - SQL
EMPLOYEE  CALCULATE EMPLOYEE SALARY  Hi friend, Please give the full details of Problem. Thanks
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
Employee Salaries
salary of the Employee. Write a program that lets a user create Employee objects...Employee Salaries  Define a class Employee with the following..., the program must print the current salary of the Employee. Note: A simple interface
Adding an employee
Adding an employee  coding for adding an employee
Add Employee
Add Employee  coding for adding an employee
employee progarm
employee progarm  Hai, I have developed a code for an employee program by using jtext fields and buttons,it has no errors but while we... java.awt.event.*; class Emp { JFrame f; JPanel p; JLabel
Employee form
Employee form  In employee form emp Id id after any data iserted is incremented for oher data insertion. insert, delete, update buttons when we cleak the select buttoun then the created table data iserted automaticaly
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name Emp_master and column name like Empcode, Empname. I like one form where I... and one report like details of employee thanks
application for an Employee
: in this page it should modify employee data and persist in DB 3.DISPLAY
compute the daily wage of an employee.
compute the daily wage of an employee.   B. Write a JavaScript program that would input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds
compute the daily wage of an employee.
compute the daily wage of an employee.   B. Write a JavaScript program that would input Employee Name, Rate per hour, No. of hours worked... program that would input Employee Name, Rate per hour, No. of hours worked
Employee Management System
Employee Management System  coding for employee management system
Employee Management System
Employee Management System  coding for employee management system
coding for employee management system
coding for employee management system  coding for employee management system
display the employee name
display the employee name  when i will select one employee designation based on that employee designation display the particular designation employee name display in another select box how it possible using servlet and mysql
Employee Management Sysem
Employee Management Sysem  coding for Daoclass Login Page Validation
Auto Generated Employee ID
Auto Generated Employee ID  Hello Everyone I want to generate an ID like (SCS-0001) and then it should be auto incremented each time a new employee add page is opens. I am using My Sql database
Generate Employee ID (SCS-0001,SCS-0002......)
Generate Employee ID (SCS-0001,SCS-0002......)  Hello everyone i am beginner in java and i am working on my major project I want to generate bill number and employee number like SCS-0001 and so on and bill number like SCS/'date
Employee Details - JSP-Servlet
Employee Details  Respected Sir/Madam, Thanks for your... for specified operation. You can't write the code, which is written... to do that, you have to forward form to either java action class or to some jsp (i.e
store the employee ID,name,login time and logout time of the employee in database
store the employee ID,name,login time and logout time of the employee in database  hello...I want to store the employee ID,name,login time and logout time of the employee along with the time difference between these two
 

 

 

DMCA.com