-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentResultSystem.cpp
155 lines (153 loc) · 4.51 KB
/
StudentResultSystem.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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include<iostream>
using namespace std;
class student
{
private:
string name, surname, division, opt_language;
int ref_no, rollNo, standard, a;
float eng,marathi,hindi,opt_lang,maths,sci,soc_sci, total, avg, percent;
public:
void get_student_info()
{
cout<<"Enter First Name: "<<endl;
cin>>name;
cout<<"Enter Surname: "<<endl;
cin>>surname;
cout<<"Enter Standard: "<<endl;
cin>>standard;
cout<<"Enter Division: "<<endl;
cin>>division;
cout<<"Enter Roll No.: "<<endl;
cin>>rollNo;
cout<<"Enter Reference No.: "<<endl;
cin>>ref_no;
if(standard>=8 || standard<=10)
{
if(division=="A"||division=="B"||division=="C")
opt_language="Hindi(Entire)";
else if(division=="D")
opt_language="Hindi-Sanskrit(Composite)";
else if(division=="E")
opt_language="Hindi-French(Composite)";
else if(division=="F")
opt_language="Sanskrit(Entire)";
}
}
void get_marks()
{
cout<<"Enter Marks out of 100:\nEnglish: "<<endl;
cin>>eng;
cout<<"\nMarathi: "<<endl;
cin>>marathi;
if (standard<8)
{
cout<<"\nHindi: "<<endl;
cin>>hindi;
}
else
{
cout<<"\nOptional Language(Hindi/Sanskrit/Hindi-Sanskrit/Hindi-French): "<<endl;
cin>>opt_lang;
}
cout<<"\nMaths: "<<endl;
cin>>maths;
cout<<"\nScience: "<<endl;
cin>>sci;
cout<<"\nSocial Science(Hist-Geog): "<<endl;
cin>>soc_sci;
}
void display_info()
{
cout<<"\n\nName: "<<name<<" "<<surname<<endl;
cout<<"Standard/Division: "<<standard<<"/"<<division<<endl;
cout<<"Roll No.: "<<rollNo<<endl;
cout<<"Reference No.: "<<ref_no<<endl;
}
void display_result()
{
if(standard<8)
{
total = eng+marathi+hindi+maths+sci+soc_sci;
avg=total/600;
percent=avg*100;
cout<<"\nMarks: "<<endl;
cout<<"English: "<<eng<<endl;
cout<<"Marathi: "<<marathi<<endl;
cout<<"Hindi: "<<hindi<<endl;
cout<<"Maths: "<<maths<<endl;
cout<<"Science: "<<sci<<endl;
cout<<"Social Science: "<<soc_sci<<endl;
}
else
{
total = eng+marathi+opt_lang+maths+sci+soc_sci;
avg=total/600;
percent=avg*100;
cout<<"\n\nName: "<<name<<" "<<surname<<endl;
cout<<"Standard/Division: "<<standard<<"/"<<division<<endl;
cout<<"Roll No.: "<<rollNo<<endl;
cout<<"\nMarks: "<<endl;
cout<<"English: "<<eng<<endl;
cout<<"Marathi: "<<marathi<<endl;
cout<<opt_language<<": "<<opt_lang<<endl;
cout<<"Maths: "<<maths<<endl;
cout<<"Science: "<<sci<<endl;
cout<<"Social Science: "<<soc_sci<<endl;
}
cout<<"Total: "<<total<<endl;
cout<<"Percentage: "<<percent<<"%"<<endl;
if(percent>90)
{
cout<<"Congratulations! You've got an A! Keep it up\n!"<<endl;
}
else if(percent>75)
{
cout<<"You've got a B! Good work!\n"<<endl;
}
else if(percent>50)
{
cout<<"You've got a C! Not bad!\n"<<endl;
}
else if(percent>35)
{
cout<<"You've got a D! Improve next time!\n"<<endl;
}
else
cout<<"Unfortunately, you've failed this time. No worries, better luck next time!\n"<<endl;
}
void execute()
{
cout<<"---------------Welcome to Student Result System!---------------\n\n";
do
{
cout<<"\nMake a choice: \n1. Enter Student Info\n2. Display Student Info\n3. Enter Marks\n4. Display Result\n5. Exit\n"<<endl;
cin>>a;
switch(a)
{
case 1:
get_student_info();
break;
case 2:
display_info();
break;
case 3:
get_marks();
break;
case 4:
display_result();
break;
case 5:
cout<<"\nThanks!\n"<<endl;
break;
default:
cout<<"Invalid input! Try again.\n"<<endl;
}
}while(a!=5);
}
};
int main()
{
student s;
s.execute();
return 0;
}