11-02-2011, 07:38 PM
It is required to make a list of students registered in Data Structures course. To achieve this functionality, develop a C++ program and use linked list to store student ids and names.
[FONT="]Each node in the linked list will contain three items: student id, student name, pointer to next node.[/FONT]
[FONT="]When the program starts, it should display the following menu:[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Sample Run:[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 1 (Suppose user entered 1)[/FONT]
[FONT="](Now the details of Student will be entered)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="]Student Name: Ahmad (Suppose user entered Ahmad)[/FONT]
[FONT="](If user enters an ID that is already in the list, a message should be displayed “Already in the list.”)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 2 (Suppose user entered 2)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="](Now the details of Student will be displayed)[/FONT]
[FONT="]Student ID: bc080400001[/FONT]
[FONT="]Student Name: Ahmad[/FONT]
[FONT="](If user enters an ID that is not in the list, a message should be displayed “Record not found.”)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 4 (Suppose user entered 4)[/FONT]
[FONT="](Now it will ask to enter ID to be deleted)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="](Student record with this ID will be deleted.)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 5 (Suppose user entered 5)[/FONT]
[FONT="](Now it will print all students’ information. Suppose there were three students in the list, so it will print: )[/FONT]
[FONT="]Student ID Student Name[/FONT]
[FONT="]------------- ---------------------[/FONT]
[FONT="]bc080400001 Ahmad[/FONT]
[FONT="]bc080200010 Ali[/FONT]
[FONT="]mc070400002 Hassan[/FONT]
[FONT="]Each node in the linked list will contain three items: student id, student name, pointer to next node.[/FONT]
[FONT="]When the program starts, it should display the following menu:[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Sample Run:[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 1 (Suppose user entered 1)[/FONT]
[FONT="](Now the details of Student will be entered)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="]Student Name: Ahmad (Suppose user entered Ahmad)[/FONT]
[FONT="](If user enters an ID that is already in the list, a message should be displayed “Already in the list.”)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 2 (Suppose user entered 2)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="](Now the details of Student will be displayed)[/FONT]
[FONT="]Student ID: bc080400001[/FONT]
[FONT="]Student Name: Ahmad[/FONT]
[FONT="](If user enters an ID that is not in the list, a message should be displayed “Record not found.”)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 4 (Suppose user entered 4)[/FONT]
[FONT="](Now it will ask to enter ID to be deleted)[/FONT]
[FONT="]Student ID: bc080400001 (Suppose user entered bc080400001)[/FONT]
[FONT="](Student record with this ID will be deleted.)[/FONT]
[FONT="](Main menu will be displayed again)[/FONT]
[FONT="]1- [/FONT][FONT="]Enter student information[/FONT]
[FONT="]2- [/FONT][FONT="]Search student by ID[/FONT]
[FONT="]3- [/FONT][FONT="]Search student by Name[/FONT]
[FONT="]4- [/FONT][FONT="]Delete student information[/FONT]
[FONT="]5- [/FONT][FONT="]Print all students[/FONT]
[FONT="]6- [/FONT][FONT="]Quit[/FONT]
[FONT="]Enter your choice: 5 (Suppose user entered 5)[/FONT]
[FONT="](Now it will print all students’ information. Suppose there were three students in the list, so it will print: )[/FONT]
[FONT="]Student ID Student Name[/FONT]
[FONT="]------------- ---------------------[/FONT]
[FONT="]bc080400001 Ahmad[/FONT]
[FONT="]bc080200010 Ali[/FONT]
[FONT="]mc070400002 Hassan[/FONT]
