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
frosja888 [35]
3 years ago
8

One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe

r 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: 2.2 the output is: 8.80 Your program must define and call the following function: def miles_to_laps(user_miles)
Computers and Technology
1 answer:
lana [24]3 years ago
4 0

Answer:

def miles_to_laps(user_miles):

   laps = user_miles / 0.25

   

   return laps

 

miles = float(input("Enter number of miles: "))

print('{:.2f}'.format(miles_to_laps(miles)))

Explanation:

Create a function named miles_to_laps that takes one parameter, user_miles

Inside the function, calculate the number of laps, divide the user_miles by 0.25 (Since it is stated that one lap is 0.25 miles). Return the laps

Ask the user to enter the number of miles

Call the function with that input and print the result in required format

You might be interested in
If you are uploading files you plan to edit online, you will need to convert them to Google Drive format. T or F
Amiraneli [1.4K]

Answer:

save as a word document (.docx) to keep editing offline then copy and paste into the google doc

5 0
3 years ago
(1) Prompt the user for an automobile service. Output the user's input. (1 pt) Ex: Enter desired auto service: Oil change You en
Pavlova-9 [17]

Answer:

In Python:

#1

service = input("Enter desired auto service: ")

print("You entered: "+service)

#2

if service.lower() == "oil change":

   print("Cost of oil change: $35")

elif service.lower() == "car wash":

   print("Cost of car wash: $7")

elif service.lower() == "tire rotation":

   print("Cost of tire rotation: $19")

else:

   print("Invalid Service")

Explanation:

First, we prompt the user for the auto service

service = input("Enter desired auto service: ")

Next, we print the service entered

print("You entered: "+service)

Next, we check if the service entered is available (irrespective of the sentence case used for input). If yes, the cost of the service is printed.

This is achieved using the following if conditions

For Oil Change

<em>if service.lower() == "oil change":</em>

<em>    print("Cost of oil change: $35")</em>

For Car wash

<em>elif service.lower() == "car wash":</em>

<em>    print("Cost of car wash: $7")</em>

For Tire rotation

<em>elif service.lower() == "tire rotation":</em>

<em>    print("Cost of tire rotation: $19")</em>

Any service different from the above three, is invalid

<em>else:</em>

<em>    print("Invalid Service")</em>

<em></em>

6 0
3 years ago
What type of software is developed by volunteers, contains code in the public domain, and helped to make Linux popular
valentina_108 [34]
Perhaps I’m being 5tup1d but I think your describing open source soft in general. Linux and a lot of periphery that runs on Linux is open source so it did play a large role being that it’s not proprietary like Windows and windows adjacent soft.
5 0
2 years ago
Who was responsible for the development of the rocket motor?
kiruha [24]

Answer: Robert H. Goddard

Explanation: he developed and flew the first liquid-propellant rocket

6 0
3 years ago
Read 2 more answers
The core of ___________ is the implementation of intrusion detection systems and intrusion prevention systems at entry points to
cestrela7 [59]

Answer:

sorry I can't understand what is this is

3 0
2 years ago
Other questions:
  • would specify that only selected members of the payroll and human resources department would have the right to change sensitive
    11·1 answer
  • ______ includes websites that encourage interaction and connection among people, businesses, and organizations.
    9·2 answers
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    6·1 answer
  • A(n) __ is a list of main points and sub-points of a topic to include in a presentation
    14·2 answers
  • If I could make a Short Film on any topic it would be...how could that film change the world?
    9·1 answer
  • 6
    9·1 answer
  • PLEASE HELP THIS IS CONFUSING ME
    8·2 answers
  • Where is the flash drive listed in a windows 7 save as dialog box?
    9·1 answer
  • Which part of the computer is responsible for managing memory allocation for all applications
    12·1 answer
  • This might sound crazy! But please help.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!