I tried debugging but nothing came up (I'm using xCode, btw). |
Are you sure you know what debugging means? You have a watch list of variables, and you check on their values as you step through the code 1 line at a time. If there are logic or run time errors you should be able to find them. Debugging is not compiling.
Like I said, I'm not supposed to use arrays and am supposed to get the formula for it to loop once to compute it without the array. |
I think to loop once means loop through all the values (not one of them).
I will say again : The getScore function is equivalent to the value of
(rand()%30+40)
.
The loop continues until i = 0, and
generatedScore = (rand()%30+40)
So the looping achieves nothing.
Do you know that you can put things onto multiple lines, like this:
1 2 3 4 5 6 7
|
void printGradeRange(double meanScore,
double standardDeviation,
double highestAdditionRange,
double lowestAdditionRange,
double lowestSubtractionRange,
double highestSubtractionRange)
{
|
This makes it easier to read, which aids understanding.
I would have functions that return 1 value, rather than altering multiple values via references. That way functions can do one thing, which is how it should be.
Hope this helps a bit :+)