-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.cpp
More file actions
50 lines (43 loc) · 1.15 KB
/
Student.cpp
File metadata and controls
50 lines (43 loc) · 1.15 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
#include <iostream>
#include <string>
using namespace std;
int main(){
int stdudent , subject, marks;
double percentage;
cout<<"enter number of students ";
cin >> stdudent;
cout <<"enter subjects ";
cin >> subject;
for (int i = 1; i <= stdudent; i++)
{
int sum = 0;
cout << "Student " << i << "\n";
for (int j = 0; j < subject; j++)
{
cout<<"enter marks of subject ";
cin >> marks;
sum += marks;
}
cout<<"Total Marks: " << sum <<"/" <<subject*100 << endl;
percentage = ((double)sum / (subject*100))*100;
cout <<"percentage "<< percentage << "\n";
if (percentage >= 90)
{
cout<<"Grade A+ \n" <<endl;
}else if (percentage <= 90 && percentage >80)
{
cout <<"Grade A \n";
} else if (percentage <= 80 && percentage > 70)
{
cout<<"Grade B \n";
}else if (percentage <= 70 && percentage >60)
{
cout <<"Grade C \n";
}
else
{
cout << "Sorry Improve \n\n ";
}
}
return 0;
}