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.
Do you just want to add up the grade values entered in each function?
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
double calcBasal (void)// no need to pass a value if the value isn't to be used.
{
double grade, sumOfGrades = 0;
for (int x = 1; x <= 18; x++)
{
cout << " Enter BASAL grade #" << x << " (out of 100):";
cin >> grade;
sumOfGrades += grade;// here each grade value will be added to sumOfGrades
}
double total;
total = ((sumOfGrades * 5) / 100);// the sum of all 18 grades is used here
cout << "Basal points: " << total << endl;
return total;
}
Or did you want to do something else with the grade values?