123k views
4 votes
One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input, and outputs the number of laps.

Output each floating-point value with two digits after the decimal point, which can be achieved by executing
cout << fixed << setprecision(2); once before all other cout statements.

*In c++*

2 Answers

6 votes

Answer:

def miles_to_laps(miles):

return miles / 0.25

miles = 5.2

num_of_lap = miles_to_laps(miles)

print("%0.2f miles is %0.2f lap(s)" % (miles, num_of_lap))

Step-by-step explanation:

User Awareeye
by
5.6k points
2 votes

Answer:

F(x) = x*.25

Step-by-step explanation:

the amount of miles (x) divided by 4 (four quarters in a mile) or just multiply by .25

User Domgblackwell
by
5.2k points