-
Notifications
You must be signed in to change notification settings - Fork 253
/
main.cpp
60 lines (52 loc) · 1.31 KB
/
main.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
#include "list.h"
#include "operation.h"
#include "my_data.h"
using namespace std;
void mainMenu();
List L, L_passed;
int main() {
createList(L);
createList(L_passed);
mainMenu();
return 0;
}
void mainMenu() {
address P;
infotype X;
/**
* IS : List has been created
* PR : prints menu to user
* 1. insert new data
* 2. print all data (List L)
* 3. find and print a data by ID
* 4. edit data by ID
* 5. delete data by ID
* 6. separate passed member
* 7. print all data (List L2)
* 0. exit
*/
//-------------your code here-------------
int choice;
do {
cout<<"Menu"<<endl;
cout<<"1. insert"<<endl;
cout<<"2. view member"<<endl;
cout<<"3. find and view"<<endl;
cout<<"4. find and edit"<<endl;
cout<<"5. find and delete"<<endl;
cout<<"6. separate passed member"<<endl;
cout<<"7. view passed member"<<endl;
cout<<"0. exit"<<endl;
cout<<"input choice: ";
cin>>choice;
switch(choice) {
case 1:
X = create_data();
P = allocate(X);
insertFirst(L,P)
break;
}
} while(true);
//----------------------------------------
}