trouble with keeping count of input

Hey all I have a program that I have been working on and am having some trouble with keeping count of all the users grades. I know that now I am only counting the last grade earned for each category but I want to know how to keep count of all of them so my calculations are correct. Any help would be appreciated.
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
#include <iostream>
#include <iomanip>
using namespace std;

double calcBasal (double grade)
{
for (int x = 1; x <= 18; x++)
	{
		cout << " Enter BASAL grade #" << x << " (out of 100):";
		cin >> grade;
	}

	double total;
	total = (((grade * 5) / 100)* 18);
	cout << "Basal points: " << total << endl;

	return total;
}

double calcApes (double grade2)
{
for (int x = 1; x <= 12; x++)
	{
		cout << " Enter APES grade #" << x << " (out of 100):";
		cin >> grade2;
	}
	double total2;
	total2 = (((grade2 * 10) / 100) * 12);
	cout << "Apes points: " << total2 << endl;

	return total2;
}
double calcQuiz (double grade3)
{
for (int x = 1; x <= 8; x++)
	{
		cout << " Enter quiz grade #" << x << " (out of 100):";
		cin >> grade3;
	}
	double total3;
	total3 = (((grade3 * 10) / 100) * 8);
	cout << "Quiz points: " << total3 << endl;

	return total3;
}
double calcMini (double grade4)
{
	cout << "How many mini problems have you solved? ";
	cin >> grade4;
	double total4;
	total4 = (grade4 * 2);
	cout << "Mini-problems points: " << total4 << endl;

	return total4;
}
double calcLetterGrade(double percentage)
{

	if (percentage >= 95)
	{
		cout << "You got an A" << endl;
	}
	else if (percentage >= 90 && percentage < 95)
	{
		cout << "You got a A-" << endl;
	}
	else if (percentage >=85 && percentage < 90)
	{
		cout << "You got a B" << endl;
	}
	else if (percentage >= 80 && percentage < 85)
	{
		cout << "You got a B-" << endl;
	}
	else if (percentage >= 75 && percentage < 80)
	{
		cout << "You got a C" << endl;
	}
	else if (percentage >= 70 && percentage < 75)
	{
		cout << "You got a C-" << endl;
	}
	else if (percentage >= 65 && percentage < 70)
	{
		cout << "You got a D" << endl;
	}
	else if (percentage >= 60 && percentage < 65)
	{
		cout << "You got a D-" << endl;
	}
	else
	{
		cout << "You got a F" << endl;
	}
	return percentage;
}

int main()
{
	double grade = 0, grade2 = 0, grade3 = 0, grade4 = 0, grade5, grandTotal, percentage;
	
	grandTotal = calcBasal(grade);
	grandTotal += calcApes(grade2);
	grandTotal += calcQuiz(grade3);
	grandTotal += calcMini(grade4);
	cout << "Enter final exam grade (or a guess) (out of 100): ";
	cin >> grade5;
	grandTotal += grade5;
	cout << "Total points: " << grandTotal << endl;
	percentage = ((grandTotal / 465) * 100);
	cout << "Percentage score: " << setiosflags(ios::fixed) << setprecision(4) << percentage << endl;
	calcLetterGrade(percentage);
	
}
Topic archived. No new replies allowed.