-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLAB Pro.cpp
More file actions
120 lines (115 loc) · 3.34 KB
/
Copy pathLAB Pro.cpp
File metadata and controls
120 lines (115 loc) · 3.34 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include<iostream>
#include<string>
using namespace std;
struct r {
string name;
int rollno;
string dep;
string uni;
string city;
string count;
string cont;
int mark;
int totmark;
bool P;
};
int main() {
int choice;
const int HashamSize= 10;
r Hasham[HashamSize];
int Studentcou = 0;
do {
cout << " \n ________*^^ Student Record Menu ^^*___________\n";
cout<<endl;
cout << " 1. Add Student Record"<<endl;
cout << " 2. Display All Records"<<endl;
cout << " 3. Exit"<<endl;
cout<<endl;
cout << "Enter your choice: "<<endl;
cin >> choice;
cin.ignore();
cout<<endl;
switch(choice){
case 1:
if(Studentcou<HashamSize){
cout<<"***Enter the name of the student : "<<endl;
getline(cin,Hasham[Studentcou].name);
cout<<endl;
cout<<"^^^Enter the Roll.No of the student: "<<endl;
cin>>Hasham[Studentcou].rollno;
cin.ignore();
cout<<endl;
cout<<"###Enter the departement of the student: "<<endl;
getline(cin,Hasham[Studentcou].dep);
cout<<endl;
cout<<"~~~Enter the name of the University of the student: "<<endl;
getline(cin,Hasham[Studentcou].uni);
cout<<endl;
cout<<"---Enter the Country of the Student : "<<endl;
getline(cin,Hasham[Studentcou].count);
cout<<endl;
cout<<"___Enter the City of the Student : "<<endl;
getline(cin,Hasham[Studentcou].city);
cout<<endl;
cout<<"<><>Enter the Contact Number of the student: "<<endl;
cin>>Hasham[Studentcou].cont;
cin.ignore();
cout<<endl;
cout<<"...Enter the Marks of the student: "<<endl;
cin>>Hasham[Studentcou].mark;
cin.ignore();
cout<<endl;
cout<<"```Enter the total marks of the student: "<<endl;
cin>>Hasham[Studentcou].totmark;
cin.ignore();
cout<<endl;
cout<<"&^^Does the student passed the Exam: (1 for 'Yes' / 0 for 'No')"<<endl;
cin>>Hasham[Studentcou].P;
cin.ignore();
Studentcou++;
}
else
{
cout<<"Maximum no of student reached."<<endl;
}
break;
case 2:
if(Studentcou==0){
cout<<"No student records to display."<<endl;
}
else {
for(int i=0; i<Studentcou; ++i){
cout << "\n--- Student " << i + 1 << " Details ---"<<endl;
cout<<endl;
cout<<"The Name of the Student is: "<<Hasham[i].name<<endl;
cout<<endl;
cout<<"The Roll.No of the Student: "<<Hasham[i].rollno<<endl;
cout<<endl;
cout<<"The Departement of the Student is: "<<Hasham[i].dep<<endl;
cout<<endl;
cout<<"The Name of the University is: "<<Hasham[i].uni<<endl;
cout<<endl;
cout<<"The City of the University: "<<Hasham[i].city<<endl;
cout<<endl;
cout<<"The Country of the University: "<<Hasham[i].count<<endl;
cout<<endl;
cout<<"The Contact Number of the Student is: "<<Hasham[i].cont<<endl;
cout<<endl;
cout<<"The Marks of the Student is: "<<Hasham[i].mark<<endl;
cout<<endl;
cout<<"The Total Marks of the Student: "<<Hasham[i].totmark<<endl;
cout<<endl;
cout<<"The Exam of the Student's Subject is : "<<(Hasham[i].P ? "Passed":"Not Passed Yet")<<endl;
}
break;
case 3:
cout << "Exiting the program.\n";
break;
default:
cout << "Invalid choice. Please select a valid option."<<endl;
}
}
}
while (choice != 3);
return 0;
}