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
TCP and the User Datagram Protocol (UDP) provide _________ between processes on any two of those hosts. A. address translation B
Fynjy0 [20]

TCP is known to be a type of a connection-oriented protocol, while UDP is a connectionless protocol. TCP and UDP provide data transport between hosts.

  • TCP and UDP are known for their speed, as TCP is slower and can retransmit lost data packets than UDP. UDP is said to be faster, simpler, and efficient protocol.

Data transport is simply known to be an the energy problem. It is the amount of energy needed to transport a bit from the closest neighbor.

Data Transport Service gives  a reliable connection for moving large amounts of data at very fast speeds.

Learn more from

brainly.com/question/17695822

6 0
2 years ago
You want to drive traffic to a new landing page for a campaign, and want a web address that's short, easy to remember, trackable
Akimi4 [234]

Hootsuite supports you with vanity URLs.

1. vanity URLs

<u>Explanation:</u>

Since the website webpage is landing on campaign, heavy network traffic is expected. Better to have multiple URL methods but it will not solve the purpose of heavy of network access of webpage or web site. Better to use vanity URLS methods to use heavy network traffic.

Vanity URLS means is customizable redirecting or rerouting by branding links or customized URL link. These type of vanity URLS by choosing hosting service and customize link been created. So end user can use link.

6 0
2 years ago
Which command button contains the following sub options as given in the picture?
DiKsa [7]

Answer:

D) Slide options

Explanation:

hope this helps

7 0
3 years ago
Read 2 more answers
What is Microsoft Excel?​
pashok25 [27]

Answer:

The most popular and widely used spread sheet program, developed by Microsoft Corporation of USA is called Microsoft Excel.

Explanation:

Thanks!!!!!

5 0
3 years ago
Can you prove that the bleu areas are the same please?
Nookie1986 [14]

\huge\color{darkred}{ \tt{NO!!}}

8 0
2 years ago
Read 2 more answers
Other questions:
  • 1. How does inertia affect a person who is not wearing a seatbelt during a collision? 
    14·2 answers
  • With a _____ network connection, the computers and other devices on the network are physically connected via cabling to the netw
    13·1 answer
  • What are two examples of ways an electronic record may be distributed to others?
    15·1 answer
  • I am bad with excell pleasee heelp
    15·1 answer
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • How do I get the bot token for discord? (scripting etc)
    5·1 answer
  • PLS REPLY ASAP WILL MARK BRAINLIEST
    5·2 answers
  • Helpppppp me please cuz its due rn. put the correct word in the correct spot
    14·1 answer
  • Molly claims that she doesn’t have to proofread her code for typos because the interpreter will catch her mistakes for her. Is s
    10·1 answer
  • You have implemented an access control method that only allows users who are managers to access specific data. Which type of acc
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!