-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
84 lines (75 loc) · 1.76 KB
/
Copy pathmain.cpp
File metadata and controls
84 lines (75 loc) · 1.76 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include "auth.h"
#include "student.h"
using namespace std;
int main()
{
int authChoise;
bool isAuthenticated = false;
cout << "Welcome to the student record system" << endl;
do
{
cout << "\n1. Login\n2. Signup\n3. Exit\nChoose an option: ";
cin >> authChoise;
switch (authChoise)
{
case 1:
isAuthenticated = login();
break;
case 2:
signup();
break;
case 3:
cout << "Program Terminated" << endl;
return 0;
default:
cout << "Invalid input" << endl;
break;
}
} while (!isAuthenticated);
int choice;
do
{
cout << "\n--- Main Menu ---\n";
cout << "1. Add Student\n";
cout << "2. Display All Students\n";
cout << "3. Search Student\n";
cout << "4. Update Student\n";
cout << "5. Delete Student\n";
cout << "6. Exit\n";
cout << "Enter your choice: ";
cin >> choice;
if (cin.fail())
{
cin.clear();
cin.ignore(10000, '\n');
cout << "Invalid input. Please enter a number.\n";
continue;
}
switch (choice)
{
case 1:
addstudent();
break;
case 2:
displaystudent();
break;
case 3:
searchstudent();
break;
case 4:
updateStudent();
break;
case 5:
deletestudent();
break;
case 6:
cout << "Goodbye!\n";
break;
default:
cout << "Invalid choice.\n";
break;
}
} while (choice != 6);
return 0;
}