Assignment
Write a C++ program to implement employee directory, which will let the organization to perform the following functions:
1) Insert the record of new employee
2) Delete the record of an existing employee
3) Find the record of an existing employee
4) Display Report
Following information of each employee will be stored
Employee ID: an integer value to store the unique id for each employee
Employee Name: the name of each employee.
Employee Address: Address of each employee
Employee Salary: a float value to store salary of each employee.
Hint:
Following information of each employee will be stored
Employee ID: an integer value to store the unique id for each employee
Employee Name: the name of each employee.
Employee Address: Address of each employee
Employee Salary: a float value to store salary of each employee.
You can use the following structure to store the information of a single employee:
Struct Employee {
Int empID;
Char *empName;
Char *empAddress;
Float empSalary;
Employee * pNext;
}Following is the sample interaction:
Welcome to <company name> employee directory:
1) Insert New employee
2) Find employee
3) Delete a record
4) Display Report
5) Exit
Enter your choice: 1
Enter EmpID: 1
Enter EmpName: Ali
Enter EmpAddress: VU, Lahore
Enter Emp Salary: 20000
Record successfully inserted (Press any Key to continue….)
After the user presses any key the screen will be cleared and the menu will be displayed again.
Welcome to <company name> employee directory:
1) Insert New employee
2) Find employee
3) Delete a record
4) Display Report
5) Exit
Enter your choice: 3 (Now user enters 3)
Enter EmpID: 1
Record successfully deleted (Press any key to continue…)
After user presses any key the screen will be cleared and menu will be displayed again.
Welcome to <company name> employee directory:
1) Insert New employee
2) Find employee
3) Delete a record
4) Display Report
5) Exit
Enter your choice: 2 (Now user enters 3)
Enter EmployeID: 1
Employee successfully deleted (Press any key to continue…)
After user presses any key the screen will be cleared and menu will be displayed again
Welcome to <company name> employee directory:
1) Insert New employee
2) Find employee
3) Delete a record
4) Display Report
5) Exit
Enter your choice: 4 (Now user enters 4)
EmpID EmpName EmpAddress EmpSalary
2 Raza VU, Lahore 20000
3 Waseem VU, Lahore 25000
5 Aslam VU, Lahore 20000
Press any key to continue…
After user presses any key the screen will be cleared again and menu will be displayed
Welcome to <company name> employee directory:
6) Insert New employee
7) Find employee
1) Delete a record
2) Display Report
3) Exit
Enter your choice: 5 (Now user enters 5)
Are you sure, you want to exit(y/n) y
Program exited if user presses “y” and menu will be displayed again if user presses “n”