... C++.

Fig. 4.13 Pseudocode for examination-results problem.

Alternate View

 1   Initialize passes to zero
 2   Initialize failures to zero
 3   Initialize student counter to one
 4
 5   While student counter is less than or equal to 10
 6      Prompt the user to enter the next exam result
 7      Input the next exam result
 8
 9      If the student passed
10         Add one to passes
11      Else
12         Add one to failures
13
14      Add one to student counter
15
16   Print the number of passes
17   Print the number of failures
18
19   If more than eight students passed
20      Print “Bonus to instructor!”

4.11.6 Program That Implements the Pseudocode Algorithm

The program that implements the pseudocode ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.