![dundiedoo7196](/avatars/36814.jpg)
dundiedoo7196
31.07.2020 •
Computers and Technology
LAB: Miles to track laps. (PLEASE CODE IN PYTHON)
Instructor note:
Note: this section of your textbook contains activities that you will complete for points. To ensure your work is scored, please access this page from the assignment link provided in Blackboard. If you did not access this page via Blackboard, please do so now.
One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a number of miles as an argument and returns the number of laps. Complete the program to output the number of laps.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print('{:.2f}'.format(your_value))
Ex: If the input is:
1.5
the output is:
6.00
Ex: If the input is:
2.2
the output is:
8.80
Your program must define and call the following function:
def miles_to_laps(user_miles)
Solved
Show answers
More tips
- S Style and Beauty How to Grow Hair Faster: Real Methods and Advice...
- F Family and Home How to Remove Fading from Clothes: Tips and Tricks...
- F Food and Cooking How to Make Polendwitsa at Home?...
- F Family and Home Parents or Environment: Who Has the Most Influence on a Child s Upbringing?...
- P Philosophy Unbelievable stories of encounters with otherworldly forces...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
- H Health and Medicine How to Treat Whooping Cough in Children?...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
Answers on questions: Computers and Technology
- H History What led to early villages evolving into complex societies? People specialized in tasks that helped with food production and hunting. When bad weather caused flooding,...
- H History Which best states why multimedia presentations use many forms of communication? to make the speaker appear more trustworthy to impress the audience with new technology...
- M Mathematics What is the surface area of the following prism?...
- B Biology Scientists often ask questions to clarify data or guide scientific research. What are two scientific questions you have that could clarify relationships about the DNA...
Ответ:
The program converts the number of miles enters by the user to an equivalent measure in laps is written in python 3 thus :
def miles_to_laps(miles):
#initialize the function which takes in a single parameter
return (miles/0.25)
mile_value= eval(input("Number of Miles: "))
#allows user to input a value representing distance in miles
print("Number of laps: ",end="")
#display Number o laps with cursor on th same line
print('{:.2f}'.format(miles_to_laps(mile_value)))
#pass user's vlaue to the function to Obtain the lap value.
A sample run of the program is attached.
Ответ:
The program in python is as follows:
def miles_to_laps(user_miles):
return (user_miles/0.25)
mile = float(input("Number of Miles: "))
print("Number of laps: ",end="")
print('{:.2f}'.format(miles_to_laps(mile)))
Explanation:
The first line defines the function miles_to_lap
def miles_to_laps(user_miles):
This line returns the equivalent number of laps
return (user_miles/0.25)
The main method starts here
This line prompts user for input
mile = float(input("Number of Miles: "))
This line prints the string "Number of laps", without the quotes
print("Number of laps: ",end="")
This prints the equivalent number of laps to two decimal places
print('{:.2f}'.format(miles_to_laps(mile)))
Ответ:
1. helicase unzips dna to separate strands.
2. topoisomerase unwinds the coiled dna.
3. primase lays down short rna strands.
4. polymerase synthesizes new dna strands.
5. the new strands are glued using ligase.