the quetion said :
Write a pesudocode to find the average of the students grade for ten subjects in the class
HINT: use while statementokay i answered this question like this :
#include <iostream>
using namespace std;
int main ()
{
int total = 0 , gradecounter = 1 , grade ;
while (gradecounter <= 10)
{
cout<<"Enter grade";
cin>>grade;
total= total + grade;
gradecounter++;
}
cout<<total / 10;system ("Pause");
return 0;
}
BUT the problem is that the output not right !!please help me guys i have evaluation tommorrow !!

1. That is not pseudocode. 2. What input did you give? What output did you expect? What output did you get?
okay i will make this clear to you ( ijack)
see the number 1 ignore it okay..
number 2 : the input is there in the question , the output i get, i feel is wrong because it is Repeated ..so i hope its clear to you now
:)
I think you misunderstand. You don't show what numbers you entered and what number was printed as the result. In what way was it wrong? Are you saying that whatever was printed was printed more than once? Just looking at the code that doesn't make sense. You need to show us exactly what you entered and what was printed.
they give the pseudocode , and it answered like that: set total to zero
set grade counter to one
while grade counter is less than or equal to ten
input the next grade
add the grade into the total
add one to the grade counter
set the class average to the total divided by ten
print the class averagehope it is clear now ;p
There's a lack of communication here, and I don't have the time to pursue it further. Perhaps someone else will have more patience.
okay no problems :)
ArwaMohammed: BUT the problem is that the output not right !!
What is the output you're getting?
What is the output you're expecting?
in output i get ( Enter grade ) but it was printed more than one !! but i expect that the answer will be different ..
in output i get ( Enter grade ) but it was printed more than one !!
Then move that line out of the loop.
Then move that line out of the loop.
which line you mean ?
Mmm. That's the real question, ain't it? Don't loose heart; it should be easy for you to answer, because you wrote this, right?
hhhhhhhhhh you make me laugh my friend ...... i really dont know what are you talking about ;P ..... PLEASE help me i want an answer .... the time in my country is too late , i want to sleep Hhhhh .... tommorrow i have an evaluation ... >.< !!
One more try. You want the prompt to be printed more than once; once for each of the ten grades that you want to enter. So, again, what is your problem?
