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.

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 a month 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
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
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
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 use for loop print **********========== in c language
write a program to use for loop print **********========== in c language  write a program to use for loop print **========== in c language
jsp code for employee attendance tracking system
jsp code for employee attendance tracking system  i need jsp code for employee attendance tracking system...it should contain date,login time,logout time,difference time in hour in separate fields..plz show the flow of detail
get details of employee after enter the emp_id
get details of employee after enter the emp_id  how to get employee details after entered the emp_id from database after that we have three more option add new,modify and delet employee   Please visit the following
get details of employee after enter the emp_id
get details of employee after enter the emp_id  how to get employee details after entered the emp_id from database after that we have three more option add new,modify and delet employee   Please visit the following
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
displaying employee records and their images problem - JSP-Servlet
displaying employee records and their images problem  hi, Thanks for your reply to my question. The code you sent to me yesterday was not working. it doesn't display any record and image. Please, help me out urgent
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
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
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 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
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 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
retrive the employee details with image from mysql database using jsp servlet
retrive the employee details with image from mysql database using jsp servlet  im doing the web project to retrive the employee profile which i stored in the database using jsp servlet then want to show the result in the next jsp
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILES,IF I ENTER 4 EMPLOYEE DETAILS(NAME,ID,SALARY,EMAIL) ALL THE DETAILS OF 4
select employee name based on his/her designation in selectbox
select employee name based on his/her designation in selectbox  i have two select boxes in one select box i am enter designation when i select designation then display employee name another select box based on designation
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
 

 

 

DMCA.com