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 LAB: UserDefined Functions: Step counter
A pedometer treats walkitig steps as walking 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 decimal piaces
if the input of the program is
the function returns and the outplit of the program is
Your program should define and call a function:
Function stepspoMiles integer usersteps returne float nimMile
AB
LAB: UserBefined Functions Step caunter
Function Stepstofilesinteger usersteps returns float numM
Function Stepstoflilesinteger usersteps returns float nunM
numMiles usersteps
return numiles
integer steps
float miles
steps Get next input
miles: StepsToMilessteps
Put miles to output with decimal places
x:
float miles
Variatules
Notanownchmenacoting
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
