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 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
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 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
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
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
Add Employee
Add Employee  coding for adding an employee
Adding an employee
Adding an employee  coding for adding an employee
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 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 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
coding for employee management system
coding for employee management system  coding for employee management system
Employee Management System
Employee Management System  coding for employee management system
Employee Management System
Employee Management System  coding for employee management system
write a program to demonstrate wrapper class and its methods......
write a program to demonstrate wrapper class and its methods......  write a program to demonstrate wrapper class and its methods
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
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
write a program to evaluate the following investment equation make use of wrapper class v=p(1+r)rest to n
write a program to evaluate the following investment equation make use of wrapper class v=p(1+r)rest to n  write a program to evaluate the following investment equation make use of wrapper class v=p(1+r)rest to n
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
write a program to calculate volume of a cube, cylinder, rectangular box using method overloading
write a program to calculate volume of a cube  write a program to calculate volume of a cube, cylinder, rectangular box using method overloading...;class
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
jsp code for employee payroll - JSP-Servlet
to calculate the employee tax using the jsp code  Hi Friend, Try the following code: 1)employee.jsp: Employee Name: Number of Hours worked...jsp code for employee payroll  jsp code for employee payroll. i need
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-age'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-age'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-age' How to remove
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id' How to remove
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product' How to remove
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-id' How to remove
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-product' How to remove
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-seniority'
ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-seniority'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo10-addon-hr-employee-seniority' How to remove
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-firstname'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-firstname'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-firstname' How to remove
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-age'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-age'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-age' How to remove
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-id' How to remove
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-seniority'
ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-seniority'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-hr-employee-seniority' How to remove
ModuleNotFoundError: No module named 'odoo11-addon-partner-employee-quantity'
ModuleNotFoundError: No module named 'odoo11-addon-partner-employee-quantity'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-partner-employee-quantity' How
ModuleNotFoundError: No module named 'odoo11-addon-stock-request-employee'
ModuleNotFoundError: No module named 'odoo11-addon-stock-request-employee'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-stock-request-employee' How to remove
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document' How to remove
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document' How to remove
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'
ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-hr-employee-document' How to remove

Ads