8. (30pts) Write a complete Java program, including comments, to do the following: You are to write a program which will assi 8. (30pts) Write a complete Java program, including comments, to do the following: You are to write a program which will assign and print a bowler’s ranking. The ranking will be based on scores received on three games You are to proceed as follows: a) Prompt the user to enter a given bowler’s data from the keyboard. The data consists of the bowler’s ID, and the bowler’s scores in the first, second, and third games. The program should call these variables: id; gamel; game2; and game3 respectively. The program should print the original information read A typical set of data could be 1234 250 195 210 b) Each game score entered is to be checked. If the score entered was negative, add 150 to the score as many times as needed to bring the grade into the range 0..300 (e.g., -100 becomes+50). Ifthe score was greater than 300, replace it by the remainder of the score divided by 300 (e.g., 823 becomes 223). c) The bowler’s ranking is to be calculated from the corrected scores. The average game score (a real number) will be computed on the following basis: each of the first two games counts 30% and the third game counts 40%. The program will call this value game_avg. d) The program will then print the bowler’s ID, the corrected game scores, the average game score (to 2 decimal places) and a one character ranking based on the bowler’s average game score as follows: game avg ->ranking 250..300 200..249> E (for Excellent) 150..199 A (for Average 100..149 B (for Beginner) 0..99 P (for Professional) >R (for Rookie) e) Repeat the entire series of operations for each successive bowler until all bowlers have been processed. Make it work for a variable number of bowlers. Count and print how many bowlers have been processed. Use a sentinel to determine the end of the data set.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *