Write a C program (with meaningful comments) to solve a problem described in English. Create an IPO.
We want to count how many passing grades are entered. We don’t know how many grades there will be. Use a sentinel controlled while loop that will ask the user to enter student grades until a value of -1 is entered. Use a counter variable to count all the grades that are passing grades, where 70 is the minimum passing grade. If there are any grades that are out of the range 0 – 100, present an error message to the user, and do not count that grade as passing. We also would like to see what percentage of the valid grades are passing (Please note that this is calculated by dividing number of passing grades with number of valid grades and multiplying by 100).
Create two more test cases.
Use following one in addition to the two you create.
Grades Entered: Expected Results
45
90
70
87
123 “That is not a valid grade!”
100
-1 You entered 4 passing grades.
80.0% of the valid grades entered are passing grades
to do:
- An IPO or Flowchart for the problem (10 points)
- Two test cases that show two sets of input data, and the expected results of running the program for each set of input data. These are to be written separately before running the program and taking the screen shots. ( 5 points)
- The code that solves the passing grades problem. Remember to use meaningful comments. (60 points)
- Output from running the program 3 different times. Use two test cases that you created and the one I have given you. (5 points)