1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pychu [463]
2 years ago
14

You have been asked to write a program for the Duckie's Obstacle Race. The program calculates the total number of racers, the fa

stest race time, the slowest race time, and the overall average race time.
Ask user to enter the maximum number of racers allowed for the race
Use repetition structure (loop) to ask the user to enter race times (in minutes)
Exit the loop if the user specifies there are no more times to enter (sentinel value) or if the maximum number of racers allowed has been reached
At a minimum, within the loop, you should keep track of how many race times are entered, the fastest race time and the slowest race time.
After the loop is exited, display how many race times were entered, the fastest race time, the slowest race time and the overall average race time.
Format your output appropriately
Be sure to include all appropriate documentation at the start of the program and within the program body
Computers and Technology
1 answer:
oksano4ka [1.4K]2 years ago
4 0

The program illustrates the use of loops and conditional statements

  • Conditional statements are used to make decisions
  • Loops are used for operations that must be repeated until a certain condition is met.

<h3>The race program</h3>

The program written in Python, where comments are used to explain each action is as follows:

#This initializes the variables to 0

totalRaceTime = 0; minRaceTime = 0; maxRaceTime = 0; countTimes = 0

#This gets input for the number of race times

numTimes = int(input("Number of times: "))

#This opens a sentinel controlled loop

while countTimes < numTimes:

   #This gets the race time

   raceTime = int(input("Race time: "))

   if countTimes == 0:

       minRaceTime = raceTime

       maxRaceTime = raceTime

   #This determines the highest race time

   if raceTime > maxRaceTime:

       maxRaceTime = raceTime

   #This determines the leest race time

   if raceTime < minRaceTime:

       minRaceTime = raceTime

   #This determines the total race time

   totalRaceTime+=raceTime

   countTimes+=1

#This prints the highest race time

print("Maximum: ",maxRaceTime)

#This prints the least race time

print("Minimum: ",minRaceTime)

#This prints the average race time

print("Average: ",round(totalRaceTime/numTimes,2))

Read more about while loops and conditional statements at:

brainly.com/question/24833629

You might be interested in
______ is used to extract knowledge from sources of data-NoSQL databases, Hadoop data stores, and data warehouses-to provide dec
Alex777 [14]

Answer: Data analytics

Explanation:

3 0
3 years ago
Fill in the blanks using A to J below.
Gre4nikov [31]

Answer:

A.software written to meet specific needs of company

B.Related specialized programs combined in a unified package

4 0
3 years ago
Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
astraxan [27]

Answer:

Check the explanation

Explanation:

• We are taking a look at the class B network beginning with 172.0.0.0.0,while Converting this value to binary as:10101100.00010100.00000000.00000000.  32 bits in total, out of this the First 16 bits that are used as network ID and the subsequent 16 bits are used as HostID.Out of the 16 bits that are sued for Network ID the 2 bits namely Bits fifteen and sixteen (15 and 16) have been set and can't be changed and hence only 14 bits are used as network ID.

• Now so that we can divide this network into 50 subnets for class B network we will have to borrow a bit as shown below:

• 10101100.00010100.00000000.00000000=172.0.0.0.0,Adding 1 bit by borrowing from host portion and adding it to network ID will give it 10101100.00010100.00000000.00000000(0 shown in bold) or10101100.00010100.10000000.00000000 (1 shown in bold) will give us 2 unique subnets.i.e changing 1 bit will give us 2 power 1=2 subnets,thus changing 2 bits will give us 2 power 2 subnets =4 similarly changing 6 bits will give us 64 unique subnets.

• Which means and going by the above problem statement in case we need 50 subnets and we also need to change 6 bits in the Network ID to give 50 unique subnets.

• Thus the answer is 6

3 0
4 years ago
Top 5 best comedy or action movies.
Cloud [144]
Comedy movies you should watch is
grown ups
spider man into the spider verse
action movies you can do
like a fast and furious movie ?
some cool scary movies are
the strangers
insidious
and the serbian film :)
7 0
3 years ago
Read 2 more answers
A mobile app design for an Apple iPhone works for an Android phone as well
Fantom [35]
No because its created for ios
4 0
4 years ago
Read 2 more answers
Other questions:
  • When an object is instantiated, it receives its own copy of all static variables of the class?
    14·1 answer
  • Do you think an employer can accurately judge an applicant’s skills and character by reviewing his/her job application? Why or w
    14·1 answer
  • Which of the file names below follows standard file naming convention?
    12·2 answers
  • A company has a five-member team in charge of development and maintenance of its information systems. An information system is i
    14·1 answer
  • How can you have a safe browsing experience?
    10·2 answers
  • Question 19
    9·2 answers
  • PLEASE HELP ASAP!!!!!!!!!!!
    7·2 answers
  • Edhesive assignment 7 calendar
    10·1 answer
  • Which validation check can be used on the following data. "XX000" 
    9·1 answer
  • Select the correct answer from each drop-down menu. The following diagram shows four resistors. What is the effective resistance
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!