-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAggregate.cpp
More file actions
34 lines (28 loc) · 852 Bytes
/
Copy pathAggregate.cpp
File metadata and controls
34 lines (28 loc) · 852 Bytes
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
#include <iostream>
using namespace std;
int main()
{
float subject1, subject2, subject3;
float totalMarks, percentage;
cout << "Enter marks for Subject 1: ";
cin >> subject1;
cout << "Enter marks for Subject 2: ";
cin >> subject2;
cout << "Enter marks for Subject 3: ";
cin >> subject3;
totalMarks = subject1 + subject2 + subject3;
percentage = (totalMarks / 300.0) * 100;
cout << "Total Marks: " << totalMarks << endl;
cout << "Percentage: " << percentage << "%" << endl;
if (percentage >= 85)
cout << "Grade: A" << endl;
else if (percentage >= 70)
cout << "Grade: B" << endl;
else if (percentage >= 60)
cout << "Grade: C" << endl;
else if (percentage >= 50)
cout << "Grade: D" << endl;
else
cout << "Grade: F" << endl;
return 0;
}