CS301 – Data Structures
Assignment No.1
Marks: 20
Deadline
Your assignment must be uploaded/submitted at or before 20 October, 2009
Uploading instructions
Your Submission must include:
- A working MakeFile (Dev-C++ project File).
- All the Source Code(.h and .cpp files) necessary to compile and run your program.
- Place all the files in a folder then Zip that folder and Upload it on VULMS
Note: Use Dev-C++ 4.9.9.2 which is available at VULMS (Download section) or you can use Dev-C++ 4.0 or any other version higher than 4.0.
Rules for Marking
It should be clear that your assignment will not get any credit if:
o The assignment is submitted after due date.
o The submitted assignment does not compile or run.
o The assignment is copied.
Objective
The objective of this assignment is
o To give you some practice exercise of Linked List.
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
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,
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
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
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
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,
3 Waseem VU,
5 Aslam VU,
Press any key to continue…
After user presses any key the screen will be cleared again and menu will be displayed
Welcome to
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”
GOOD LUCK
Post a Comment