0% found this document useful (0 votes)
20 views1 page

Calculating Grade Average

Uploaded by

Ali Guyamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Calculating Grade Average

Uploaded by

Ali Guyamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1 #include <iostream>

2
3 using namespace std;
4
5 int main()
6 {
7
8 float class1, class2, class3, sum, ave;
9
10 string FirstName = "";
11 string LastName = "";
12
13 //entering your name
14 cout << "Enter Firstname: \n" <<FirstName;
15 cin >> FirstName;
16
17 cout << "Enter LastName: \n" <<LastName;
18 cin >> LastName;
19
20 //calculating your grades
21
22 string sub1 = "Math";
23 string sub2 = "Science";
24 string sub3 = "English";
25
26 cout << "Enter your grades in " << sub1 << endl;
27 cin >> class1;
28
29 cout << "Enter your grades in " <<sub2 << endl;
30 cin >> class2;
31
32 cout << "Enter your grades in " <<sub3 << endl;
33 cin >> class3;
34
35
36 sum = class1 + class2 + class3;
37
38 ave = sum / 3;
39 cout <<"Your Average is = " << ave << endl;
40
41
42
43 return 0;
44 }
45

You might also like