link list

AOA.........please someone help me in this assignment...! thanx



When the program starts, it should display the following menu:
1- Enter student information
2- Search student by ID
3- Search student by Name
4- Delete student information
5- Print all students
6- Quit
Sample Run:
1- Enter student information
2- Search student by ID
3- Search student by Name
4- Delete student information
5- Print all students
6- Quit
Enter your choice: 1 (Suppose user entered 1)
(Now the details of Student will be entered)
Student ID: bc080400001 (Suppose user entered bc080400001)
Student Name: Ahmad (Suppose user entered Ahmad)
(If user enters an ID that is already in the list, a message should be displayed “Already in the list.”)

(Main menu will be displayed again)
1- Enter student information
2- Search student by ID
3- Search student by Name
4- Delete student information
5- Print all students
6- Quit
Enter your choice: 2 (Suppose user entered 2)
Student ID: bc080400001 (Suppose user entered bc080400001)
(Now the details of Student will be displayed)
Student ID: bc080400001
Student Name: Ahmad
(If user enters an ID that is not in the list, a message should be displayed “Record not found.”)

(Main menu will be displayed again)
1- Enter student information
2- Search student by ID
3- Search student by Name
4- Delete student information
5- Print all students
6- Quit
Enter your choice: 4 (Suppose user entered 4)
(Now it will ask to enter ID to be deleted)
Student ID: bc080400001 (Suppose user entered bc080400001)
(Student record with this ID will be deleted.)

(Main menu will be displayed again)
1- Enter student information
2- Search student by ID
3- Search student by Name
4- Delete student information
5- Print all students
6- Quit
Enter your choice: 5 (Suppose user entered 5)
(Now it will print all students’ information. Suppose there were three students in the list, so it will print: )
Student ID Student Name
------------- ---------------------
bc080400001 Ahmad
bc080200010 Ali
mc070400002 Hassan

(Main menu will be displayed again)
when I code I always start from the classic hello world program:

1
2
3
4
5
6
7
8
#include <iostream>

using namespace std;

int main( int argc, char *argv[] )
{
    cout << "hello world" << endl;
}


from here we can output the menu while user input(cin) != 6

1
2
3
4
5
6
7
8
cout << "menu element 1" << endl;
cout << "menu element 2" << endl;
cout << "menu element 3" << endl;
cout << "menu element 4" << endl;
cout << "menu element 5" << endl;
cout << "menu element 6" << endl;
cout << "Enter your selection here: "
cin >> userReply;


then for the link list you have loads of tutorials online: heres one:
http://www.functionx.com/cpp/articles/linkedlist.htm

that should give you a good start.
thanks Zachray....i can understand lil bit..!its a starting of code...?
int main( int argc, char *argv[] )

I wouldn't worry about parsing in command line input; it's really not necessary here.
closed account (10oTURfi)
http://www.cplusplus.com/forum/beginner/53824/

Really?
i'll contribute by sayin the next part of the program should be like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
switch(userReply)
{
case '1':
// add function here
break;

case '2':
// add function here
break;

// all the way to case 6  make separate functions for each user response

// If you want to make it trickier add a 7th option that allows new student to be entered and make a heap that stores there new info an adds it to the current list of data!














Topic archived. No new replies allowed.