### Track laps to miles

One lap around a standard high-school running track is exactly 0.25 miles. Define a function named LapsToMiles that takes a double as a parameter, representing the number of laps, and returns a double that represents the number of miles. Then, write a main program that takes a number of laps as an input, calls function LapsToMiles() to calculate the number of miles, and outputs the number of miles.

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.

Ex: If the input is:

7.6
the output is:

1.90

-Here is my code:

 ``1234567891011121314151617181920`` ``````#include #include // For setprecision using namespace std; / Defined function here / double LapsToMiles(double userLaps) { double numLaps; return userLaps / 0.25; } /Actual Code/ int main() { double userLaps; cin>>userLaps; cout<

It is currently outputting: 30.40
Last edited on

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.