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

 
 


madguy
Write a program that makes use of a class called Employee that will calculate an employee's weekly paycheque.
2 Answer(s)      11 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
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 Pages:
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
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
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
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
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
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
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 - SQL
EMPLOYEE  CALCULATE EMPLOYEE SALARY  Hi friend, Please give the full details of Problem. Thanks
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
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
Uploading Employee Profile with image
Uploading Employee Profile with image  ... to use Jsp for performing any logic, as Jsp is mainly used for the presentation logic, but at least we should know how we can use a java code inside the jsp
Uploading Employee Profile with image
Uploading Employee Profile with image  ... to use Jsp for performing any logic, as Jsp is mainly used for the presentation logic, but at least we should know how we can use a java code inside the jsp
Write a program to calculate area and perimeter of a circle
Write a program to calculate area and perimeter of a circle... example will teach you the method for preparing a program to calculate the area.... Write the program for both the cases: radius and perimeter.  Before ending
Adding an employee
Adding an employee  coding for adding an employee
Add Employee
Add Employee  coding for adding an employee
how to make employee i card
how to make employee i card  hello friends can anyone help me.. I have to make a project to make Identity card for employees...but i am facing...(); response.getOutputStream().write(rb,0,len); response.getOutputStream().flush
Write a program to calculate factorial of any given number
program to calculate factorial of any given number. First of all define a class... class, it is necessary to use 'try' and 'catch' block for catching and handling... Factorial Examples - Java Factorial Example to calculate factorial of any
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
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
application for an Employee
: in this page it should modify employee data and persist in DB 3.DISPLAY
calculate average
calculate average   Design and write a java program to determine all... and write a program and calculate your final average in this course. The details of the calculating can be found in the course syllabus. Test your program
constructor program
constructor program  write a program to calculate the gross salary and net salary of an employee based on the following attributes: empno,empname,emp address,basic,hra,da,ta,vehicle loan,personel loan use the scanner class
program
program  Create a class called Employee with member variables... called print to display the employee details in below format: "Employee E001 is working in Java department and salary is 10000". Instantiate the Employee class
write following program
to the multithreaded apartment. Threads in a multithreaded apartment use a model called...write following program  Q1 What is the difference between single...-threading. Explain with examples Q2 Write a java applet that takes your name
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
How to calculate attending hours?
How to calculate attending hours?  I need to calculate attending hours of a employee in a day in my project to make their monthly salary . By using work starting time and ending time. How should I do it using Date class? Or any
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
Program
super class method calsalary (). (Use inheritance...Program  Create a Super class Department(dno, dname, dlocation) and a method calsalary(float basic, float DA, float HRA).Define a subclass Employee
Program
super class method calsalary (). (Use inheritance...Program  Create a Super class Department(dno, dname, dlocation) and a method calsalary(float basic, float DA, float HRA).Define a subclass Employee
Add Edit And Delete Employee Information
Add Edit and Delete Employee Information Using Swing  ..., edit and delete the Employee's information from the database using java swing. For this purpose, we have used three tabs using JTabbedPane class. Under these tabs
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
Select Employee and display data from access database in a jtable
Select Employee and display data from access database in a jtable  I... a employee's name from a comboBox and the jtable will be filled with all the cutomer's first name and last name which the employee served. The first name and last
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
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
Use of write method of CheckedOutputStream class in java.
Use of write method of CheckedOutputStream class in java. In this tutorial, we will discuss the use of write(int b) method of CheckedOutputStream class... to use write(int b) method of CheckedOutputStream class. The FileInputStream class
write a java program that implements the following classes:
write a java program that implements the following classes:  write...)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 C...() methods. Use an object from the Random NumberGenerator class to generate your