Answer:
The complete program is:
#include <stdio.h>
double StepsToMiles(int userSteps){
return userSteps/2000.00;
}
int main(void) {
int userSteps;
printf("User Steps: ");
scanf("%d",&userSteps);
printf("%0.2f", StepsToMiles(userSteps));
return 0;
}
Step-by-step explanation:
This line defines the function
double StepsToMiles(int userSteps){
This returns the required output by dividing userSteps by 2000.
We used 2000.00 because we want it to return a floating point number
return userSteps/2000.00;
}
The main begins here
int main(void) {
This declares userSteps as integer
int userSteps;
This prompt user for input
printf("User Steps: ");
This gets user input
scanf("%d",&userSteps);
This calls the function and also returns the required output to 2 decimal places
printf("%0.2f", StepsToMiles(userSteps));
return 0;
}