Description
File Name:
|
H:\CPSC1150\Lab7\ClassifyScores.java |
Purpose
|
To classify a series of scores entered by the user into ranges. The scores will be numbers between 0 and 100.
. |
Input
|
The score (as many as the user wants) |
Output
|
The ranges and how many times the scores come into those ranges |
Program Logic (Pseudocode)
Algorithm LeapYear
Start
(main method)
- Initialize the array
(a) with 10 different values in int
(b) set each value to 0
- Take the array to the looping method
(looping method)
- Initialize the variables
- Set score to 0 in int
- Create a scanner
- Ask for an input
- Create a loop where the loop exits if it is less then 0
- If the score is greater then100
(i) then go to the top of loop
- Else then array[(score/10)]++
(if score is 100, score=100-1)
- Get new input
- Take the array to the printscores method
(printscores method)
- Display the output to the user
- Set the top of the display
- Create a loop for the middle values that increases by 10 to simplify work
- Print 90-100 at the end because there is 6 characters in this range rather then 5