Use a do-while statement, write a program that continuously requests a grade to be entered. If the grade is less that 0 or greater than 100, your program should print an appropriate message informing the user that an invalid grade has been entered, the program should exit the repetition loop and compute and display the average of the valid grades entered.

im still a student and i cant get the code out of this

Sample output 1:

Enter grade :85
Enter Grade:90
Enter grade:0

Invalid Grade:
Average Grade: 87.5

Sample Output 2:

Enter grade:90
Enter Grade:90
Enter grade:80
Enter Grade:75
Enter Grade:102

Invalid grade:
Average Grade:87.4???? help me with this???

8 Years
Discussion Span
Last Post by Grn Xtrm

My guess is he hasn't written a line yet, looks like an assigment to me.
Anyways your program should tell the user that a grade is invalid if it's 0<= or =>100. This should also terminate the program and print the average grade which is computeded as such

(grade[1]+grade[2]+grade[number])/ amount of grades.


Edited by K0ns3rv: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.