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
stiks02 [169]
3 years ago
7

Write a program that asks for the names of three runners and the time, in minutes (no seconds, etc.), it took each of them to fi

nish a race. The program should display the names of the runners in the order that they finished. Note, assume there are no ties.

Computers and Technology
1 answer:
Crank3 years ago
5 0

Answer:

Complete python code with explanation and output results is given below

Explanation:

User is asked to input names of runners and their finishing time

We have to determine first, second and third according to their finishing time.

if else conditioning is used to determine who has lowest finishing time.

Outer if is used to decide first position and inner if is used to decide second and third position.

str() function is used to concatenate the integer variable with string

Code:

runner1 = input("Please enter name of the runner1 ")

time1 = int(input("Please enter the time of runner1 "))

runner2 = input("Please enter name of the runner2 ")

time2 =int(input("Please Enter name of the runner2 "))

runner3 = input("Please enter name of the runner3 ")

time3 =int(input("Please Enter name of the runner3 "))

if(time1 < time2 and time1 < time3):  

   if(time2 < time3): // to decide 2nd and 3rd position

       print(runner1+" has finished First with time: "+str(time1))

       print(runner2+" has finished Second with time: "+str(time2))

       print(runner3+" has finished Third with time: "+str(time3))

   else:

       print(runner1+" has finished First with time: "+str(time1))

       print(runner3+" has finished Second with time: "+str(time3))

       print(runner2+" has finished Third with time: "+str(time2))

if(time2 < time1 and time2 < time3):  

   if(time1 < time3):

       print(runner2+" has finished First with time: "+str(time2))

       print(runner1+" has finished Second with time: "+str(time1))

       print(runner3+" has finished Third with time: "+str(time3))

   else:

       print(runner2+" has finished First with time: "+str(time2))

       print(runner3+" has finished Second with time: "+str(time3))

       print(runner1+" has finished Third with time: "+str(time1))

if(time3 < time1 and time3 < time2):

   if(time2 < time1):    

       print(runner3+" has finished First with time: "+str(time3))

       print(runner2+" has finished Second with time: "+str(time2))

       print(runner1+" has finished Third with time: "+str(time1))

   else:

       print(runner3+" has finished First with time: "+str(time3))

       print(runner1+" has finished Second with time: "+str(time1))

       print(runner2+" has finished Third with time: "+str(time2))

Output:

Program has been tested with multiple inputs and results are accurate as per problem specifications.

Please enter name of the runner1 danny

Please enter the time of runner1  45

Please enter name of the runner2  sam

Please enter the time of runner2  34

Please Enter name of the runner3  tedd

Please enter the time of runner3  23

tedd has finished First with time: 23

sam has finished Second with time: 34

danny has finished Third with time: 45

You might be interested in
14. How do digital libraries address the problem of digital exclusion?
loris [4]

The digital libraries address the problem of digital exclusion by: They reach out to people who need technology and help teach them digital literacy skills.

<h3>What does it mean to be digitally excluded?</h3>

The  digital exclusion  is known to be also as digital divide and this is known to be where a part of the population is known to possess a continuous and unequal access and capacity in regards to the use Information and Communications Technologies (ICT),

Note that IT are very essential for all to be fully participated  in the society and the digital libraries address the problem of digital exclusion by: They reach out to people who need technology and help teach them digital literacy skills.

Learn more about digital exclusion from

brainly.com/question/7478471

#SPJ1

3 0
1 year ago
The primary stream fed by tributaries within a dendritic drainage network is termed a ________ stream
a_sh-v [17]
<span>TRUNK. In a dendritic system, there are many smaller rivers or streams (the "twigs" of the tree), which are then merged into the tributaries of the main river (the branches and the trunk of the tree, respectively). They tend to develop in V-shaped valleys</span>
6 0
3 years ago
Explain why the computer is powerful working tool???​
notsponge [240]

Answer:

here ya go

Explanation:

A computer is a powerful tool because it is able to perform the information processing cycle operations (input, process, output, and storage) with amazing speed, reliability, and accuracy; store huge amounts of data and information; and communicate with other computers.

8 0
2 years ago
WHAT TYPES OF ACTIVITIES ARE PERFORMED BY HEALTH CARE SOFTWARES
Makovka662 [10]

Answer:

lectronic Health Record (EHR) Software. ...

Medical database software. ...

Medical research software. ...

Medical diagnosis software. ...

Medical imaging software. ...

E-prescribing software. ...

Telemedicine software. ...

Appointment scheduling (booking) software.

6 0
2 years ago
According to Newton's Second Law of Motion, when an object is acted on by an unbalanced force, how will that object respond?
Murrr4er [49]
A. It will decrease speed
5 0
3 years ago
Other questions:
  • How to you put a color into a cell? <br> a.Shading<br><br> b.Fill<br><br> c.Color<br><br> d.Insert
    8·1 answer
  • you were discussing software privacy with a friend were surprised to learn how software privacy can impact your life everyday. w
    10·1 answer
  • Shortcuts will help you complete spreadsheet tasks more efficiently.
    12·1 answer
  • To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
    11·1 answer
  • This finding maximum number function will keep on going until we reach at the last value
    12·1 answer
  • Coding 5 - Classes The Item class is defined for you. See the bottom of the file to see how we will run the code. Define a class
    13·1 answer
  • You designed a program to create a username using the first three letters from the first name and the first four letters of the
    6·1 answer
  • Most file managers include a way to create a folder through the save dialog box. true or false?
    9·1 answer
  • What is an analog computer?<br>​
    11·2 answers
  • Advantages and disadvantages of algorithm​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!