-
how do i find the score?
can somebody please help me with this:
the question is
how many tests did you give to the class?
and you put a number
then i have to find the average of the tests for a particular student
but i dont know how many tests the other is goin to enter
so my formula doesnt work
can you help? in any way?
-
Sum all the results of that particular student, then divide by the number of tests that student have made...
...if I understand your quite unclear question...
-
using cin
well,the code will be something like this!
void main()
{
int total_tests;
cin>>total_tests;
average=total_numbers/total_tests;
}
-
do you mean something like this?
Code:
int scores, number;
cout<<"how many?";
cin>>number;
cout<<"what are the scores?";
for (int i=0; i<number; i++)
{
int reply;
cin>>reply;
scores += reply;
}
cout<<scores/number
-
thanks a lot
thanks all of you but i tried it how blight2c had the code and it gave me the right answer, thank you :)
i was tryin to figure that out for hours and i couldnt, it finally got into my nerves and i decided to post it, i didnt think that somebody would reply but they did and thanks again :)
-
nice one
looks like blight is tha man lol.
-
i don't get it, what's so funny?
-
um, i guess what is funny was how perfectly you answered his question.
i didn't mean any offense by it though. lol don't want to start out my time in this forum making enemies.