Can't figure out equation

Hello everyone,
I need to write a program that ask the user for 18 grades, each grade out of 100, and caclulates the points value based on the score. For instance, if the user got 100 on each of the 18 quizzes then the point total would be 54. How would I write this equation. Heres my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <cstdlib>
using namespace std;
void basalGrade(int bgrade)
{
	int x, a, total = 0;
	cout << "BASAL Gradebook:" << endl;
	for (x = 1; x <= 18; x++)
	{
		
		cout << "	Enter BASAL grade #" << x << " (out of 100): ";
		cin >> a;
		total = total + a; // for illustration
	}
	cout << "BASAL points earned: " << total << endl;
}
I'm going to guess that there are up to three points available per quiz (based on a maximum possible of 54 points from all 18 quizzes). This is not enough information. What are the criteria for awarding zero/one/two/three points in the quiz?

This is all the information I have, and you are correct there are 3 points per quiz. From what I can guess I have to figure out the 54 points total based on the user grade. e.g. 1800 points = 54 pts.

Is it possible to write something like total = 3 * .a ?
closed account (o3hC5Di1)
Hi there,

I'm absolutely crap at mathematics, but it seems like a rule of three might cut it here?
Some one please correct me if I'm entirely missing the plot here.

total / 1800 * 54

I.e if the user has 1600/1800:

1600 / 1800 * 54 =
0.88888888 * 54 = 47.9999995

Hope that helps.
All the best,
NwN
Topic archived. No new replies allowed.