Question: Coral Language 5 . 1 0 LAB: User - Defined Functions: Step counter A pedometer treats walkitig 2 , 0 0 0 steps as walking

Coral Language 5.10 LAB: User-Defined Functions: Step counter
A pedometer treats walkitig 2,000 steps as walking 1 mile Defintea function named StepsTolviles trat takes an integer as a
parameter, representing the number of steps, and returns a froat that represents the number of miles walked Then, write:
main program that reads the number of steps as an input, calls function Steps ToMiles) with the input as an argument. and
outputs the miles walked
Output the result with four digits after the decimal point, whichican be achieved as follows
Put regult to putput with 4 decimal piaces
if the input of the program is
5345
the function returns and the outplit of the program is
6725
Your program should define and call a function:
Function stepspoMiles (integer usersteps) returne float nimMile
1.AB
5.10.1. LAB: User-Befined Functions Step caunter
0//10
1 Function Stepstofiles(integer usersteps) returns float numM
\ Function Stepstofliles(integer usersteps) returns float nunM
3 numMiles = usersteps/2000.0
return numiles
integer steps
float miles
steps = Get next input
miles: StepsToMiles(steps)
Put miles to output with 4 decimal places
\x: \
float miles
\
Variatules
Notanownchmenacoting
Coral Language 5 . 1 0 LAB: User - Defined

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!