Computer Programming (II)

Programming Assignment 4

April 10, 2005

 

Write the following program using stepwise refinement. Keep your steps as comments in the final C++ source code:

 

Read in a list of integer test scores ranging from 0 to 100 until a score of -1 is read to signal the end of input. Print out a vertical histogram of bracketed scores 0-9, 10-19, …, 80-89, and 90-100, as shown in the following sample output:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

*

*

 

 

 

*

 

 

 

 

 

*

*

*

 

 

*

 

 

 

 

*

*

*

*

*

 

*

 

 

*

 

*

*

*

*

*

 

*

 

 

*

*

*

*

*

*

*

 

4

0

0

2

1

3

6

7

4

3

 

0-9

10-19

20-29

30-39

40-49

50-59

60-69

70-79

80-89

90-100

 

The assignment is due midnight, April 10.