I need to write a programme which continuously requests a grade to be entered. If the grade is less than 0, cout that "this is an invalid grade". Or else the grade should be added up as a total.While a grade of 999 is entered, the programme should exit the loop and compute the average of the valid grades.
First of all, please use [.code]Some code[./code] tags (without the dot). It makes reading the code easier. To figure out how to exclude invalid grades, only keep track of the number of valid grades. Check to see if something is valid, and only if it is, count it up.