+1(978)310-4246 credencewriters@gmail.com
  

Description

Payroll System
Objectives
To provide students with the experience of using classes and functions to solve a problem.
Problems
Modify lab 4 (Payroll System) so that an employee’s data can be added, deleted, modified, and
displayed. You are asked to use a menu to provide these services for the users. The menu might look
like this:
Menu
1. Add new employees to the database.
2. Modify employee data in the database.
3. Delete employees from the database.
4. Display employee data to the screen.
5. Quit the system
Requirements
1. Design two classes to solve this problem. One class, called Employee, stores
employee’s data; the other class, called EmployeeList, holds a list of employee objects
(called a container).
2. The class Employee (Lab11) should have the data members of id, first name, last name,
rate, and hours. The following member functions should be provided:
▪ a constructor to initialize employee’s data with id, first name, last name, rate and
hours. Use default arguments.
â–ª A member function that sets the last name
â–ª A member function that sets the first name
â–ª A member function that sets the id
â–ª A member function that sets the rate
â–ª A member function that sets the hours
â–ª A member function that retrieves the last name
â–ª A member function that retrieves the first name
â–ª A member function that retrieves the id
â–ª A member function that retrieves the rate
â–ª A member function that retrieves the hours
â–ª A member function that computes and returns the wage.
The class should also have the following overloaded operators:
== this operator should check to see if two employee objects are equal.
!= this operator should check to see if two employee objects are not equal.
>> this operator should read the employee’s data from the keyboard or an input file
stream in the order of id, first name, last name, rate and hours.
y
Enter an employee’s data by the order of ID number, first name, last
name, rate, hours:
123123 Bob Johnson 20 98
Another employee? y/n –> y
Enter an employee’s data by the order of ID number, first name, last
name, rate, hours:
125689 Mary Anderson 10.5 20
Another employee? y/n –> y
Enter an employee’s data by the order of ID number, first name, last
name, rate, hours:
100251 Jane Carter 45 40
Another employee? y/n –> n
The employee database has been created.
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 1
Enter new employee’s data by the order of ID number, first Name,
last Name, rate, hours:
108790 Jim Carry 8.5 40
Another one? Y
Enter new employee’s data by the order of ID number, first Name,
last Name, rate, hours:
108790 Jim Carry 8.5 40
This employee has already been in the database.
Another one? n
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 4
XXX Company Payroll System:
ID
First Name
Last Name
123450
John
Smith
123123
Bob
Johnson
125689
Mary
Anderson
100251
Jane
Carter
Rate
12.5
20
10.5
45
Hours
80
98
20
40
Wage
1000
1960
210
1800
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 2
Enter employee’s current id: 110021
No such employee in the database.
Modify another employee? y/n → y
Enter employee’s current id: 123123
This employee has following data:
123123 Bob Johnson 20 98 1960
Change id? y/n –> n
Change first name? y/n –> n
Change last name? y/n –> y
Enter new last name: Bush
The last name has been changed.
Change rate? y/n –> y
Enter new rate: 35
The rate has been changed.
Change hours worked? y/n –> n
Modify another employee? y/n –> n
The employee data has been updated.
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 3
Enter the employee’s data to delete by the order of id, first Name,
last Name, rate, hours:
125689 Mary Anderson 10.5 20
This employee’s data is deleted.
Another employee to delete? y/n → y
Enter the employee’s data to delete by the order of id, first Name,
last Name, rate, hours:
124100 Mary Carter 7.5 20
No such employee.
Another employee to delete? y/n → n
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 4
XXX Company Payroll System:
ID
First Name
Last Name
123450
John
Smith
123123
Bob
Bush
100251
Jane
Carter
Rate
12.5
35
45
Hours
80
98
40
Wage
1000
3430
1800
******************************************************
**
Menu
**
** 1. Add new employees to the database.
**
** 2. Modify employee data in the data base.
**
** 3. Delete employees from the database.
**
** 4. Display employee data to the screen.
**
** 5. Quit the system
**
******************************************************
Please enter your choice: 5
Thanks for using XXXX Company Payroll System! All employee
information can be viewed in the file “xxxxx.dat”
What to turn in
o A typed or word-processed description of your design with two UML diagrams for
Employee and EmployeList classes desperately. An example of UML for Rectangle
class is given below:
Rectangle
-width: double
-length: double
+setWidth(w:double):void
+setLength(len:double):void
+getWidth():double
+getLength():double
+getArea():double
+operator== (stu: const Student&):bool
operator> (strm:istream&, stu:Student&):istream&
o All source programs.
o Test data with explanation.

Purchase answer to see full
attachment

  
error: Content is protected !!