Answer:
// program in C
#include <stdio.h>
// function to calculate distance traveled
void CalcPrintDistance(double vel,double min)
{
// calculate distance
double dis=(vel*min)/60;
// print distance
printf("Distance traveled by vehicle is:%0.2lf miles",dis);
}
// main function
int main(void) {
// variable
double velocity,minutes;
printf("Enter the velocity of vehicle(miles per hour):");
// read velocity
scanf("%lf",&velocity);
printf("Enter the time traveled(in minutes):");
// read time
scanf("%lf",&minutes);
// call function
CalcPrintDistance(velocity,minutes);
return 0;
}
Step-by-step explanation:
Read the velocity of vehicle and assign it to variable "velocity".Read the
time traveled by the vehicle and assign it to variable "minutes".Call the
function CalcPrintDistance() with parameter velocity and minutes.This
function will calculate the distance traveled and print it.
Output:
Enter the velocity of vehicle(miles per hour):68.2
Enter the time traveled(in minutes):34.6
Distance traveled by vehicle is:39.33 miles