QP5 - .., 91-100. For each grade range, you should print...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Quiz Program #5 Program Description: Test Grades Write a program that reads in test grades from a file called "testgrades.txt" and prints a histogram of the grades to the screen. In particular the file will have the following format: Each line of the file will contain a test grade, an integer from 1 to 100. When you read in the integer 0 on a line by itself, that signifies the end of the input. (0 should NOT be counted as one of the test grades!) Your histogram should group test scores into ten groups by score: 1-10, 11-20, 21-30, .
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .., 91-100. For each grade range, you should print out a * for each grade in that range. Sample File 99 13 87 93 14 88 57 91 35 Sample Output 1-10 11-20 ** 21-30 31-40 * 41-50 51-60 * 61-70 71-80 81-90 ** 91-100 *** In your code you must use an array of size 10 to keep track of the number of grades in each range. Furthermore, you are not allowed to use a big if statement (or switch) with 10 cases to decide which frequency counter to update. Look at the character counting example, to see a similar program to this one....
View Full Document

Ask a homework question - tutors are online