-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstudent_grader.cpp
More file actions
49 lines (46 loc) · 1.44 KB
/
student_grader.cpp
File metadata and controls
49 lines (46 loc) · 1.44 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
// Grade counter:-
#include <iostream>
using namespace std;
int main() {
int aa,a,b,c,d;
cout << "Enter marks out of hundred" << endl;
cout << "Enter the marks needed for A+ :";
cin >> aa;
cout << "\nEnter the marks needed for A :";
cin >> a;
cout << "\nEnter the marks needed for B :";
cin >> b;
cout << "\nEnter the marks needed for C :";
cin >> c;
cout << "\nEnter the marks needed for D :";
cin >> d;
cout << "How many students do you need to grade? :";
int students;
cin >> students;
int i = 0;
while(i<students) {
i++;
cout << "Enter student number " << i << "s Marks :";
int marks;
cin >> marks;
if (marks>=aa) {
cout << "The grade of this student is A+ " << endl;
} else if (marks >= a and marks < aa) {
cout << "The grade of this student is A" << endl;
} else if (marks >= b and marks < a) {
cout << "The grade of this student is B" << endl;
} else if (marks >=c and marks < b) {
cout << "The Grade of this student is C" << endl;
} else if (marks >=d and marks < c) {
cout << "the Grade of this student is D" << endl;
} else if (marks < d) {
cout << "This student Failed.";
} else{
cout << "Invalid input";
}
}
int close;
cout << "Press enter to exit this program"
cin >> close;
return 0;
}