Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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, replace it by its positive equivalent (e.g., -75 becomes +75). If the score was greater than 3 subtract 50 from the score as many times as needed to bring the acore into the range 0..300. 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: the first game counts 25%, the second game counts 35% and the third game counts 40%. The program will call this value gameAvg. 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 -> P (for Professional) 200..249 -> E (for Excellent) 150..199 -> A (for Average) 100..149 -> B (for Beginner) 0..99 -> 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How does a router differ from a VLAN?

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago