Computers and Technology

Summary You will write a racing report program using object-oriented programming with three classes:
ReportDriver, RaceReport, and Race. The main method of the program will be in the
class ReportDriver and will include a loop that allows you to enter in more than one race and
have reports written out for all the races you enter. (The user will enter one race then get a report for that race. After that, the user will be asked whether they want to enter in another race and get another report. This repeats until the user says they do not want to enter in any more races.)
Program Description
There are two major tasks in this assignment. Your first major task is to write a program that collects three pieces of user input about a race and provides a summary of facts about the race. Input will be via the keyboard and output (i. e., the summary of facts) will be via the display (a. k.a., console window). The three pieces of user input will be the three individual race times that correspond the first, second, and third top race finishers; your program will prompt the user to enter these in via the keyboard. Note that you cannot assume these times will be in order; putting them in order is one of the first things your program should do. Thus, your program will need to do the following:
1. Prompt the user for three ints or doubles, which represent the times for the three racers.
2. Sort the three scores into ascending order (i. e., least to greatest).
(a) Remember, to swap two variables requires a third, temporary variable.
(b) See the Math class (documented in Savitch Ch. 5; see the index for the exact location
. . . this is good practice for looking things up) for methods that might help you (e. g.,
min and max). Note that these methods produce a return value.
(c) Output the sorted race scores in order.
3. Describe the overlap in times, if any exist. The options will be:
(a) All are tied for first.
(b) Some are tied for first.
(c) None are tied for first.
4. Do step (4) for the second and third place finishes.
5. Output the range of the race scores.
6. Output the average of the race scores.
There are, of course, many different ways of writing this program. However, if you decompose
your tasks into smaller chunks, attacking a larger program becomes more manageable. If you
mentally divided up the tasks before you, you might have decided on the following list of "work
items", "chunks", or "modules":
Data Input: Ask the user for three race scores (in no particular order).
Ordering Data: Order the race scores by first, second, and third place.
Data Analysis and Output:
– Determine how many racers tied for first, second or third place (i. e., how many overlap
times) and output result to console.
– Calculate the range of the race scores (i. e., the absolute value of the slowest minus the
fastest times) and output result to console.
2 – Calculate the average of the race times and output result to console.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:50, michaelchavez6959127
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks. requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, jngonzo1226
Which of the following statements best describes it careers?
Answers: 2
image
Computers and Technology, 23.06.2019 00:00, puppylove899
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
Do you know the correct answer?
Summary You will write a racing report program using object-oriented programming with three classes...

Questions in other subjects:

Konu
Biology, 10.02.2020 20:22