Ask Question

Write a function so that the main () code below can be replaced by the simpler code that calls function MphAndMinutesToMiles (). Original main () : int main () { double milesPerHour; double minutesTraveled; double hoursTraveled; double milesTraveled; cin >> milesPerHour; cin >> minutesTraveled; hoursTraveled

+5
Answers (1)
  1. 10 February, 01:11
    0
    The C code is given below

    Explanation:

    #include

    / * Your solution goes here * /

    double MphAndMinutesToMiles (double milesPerHour, double minutesTraveled) {

    double hoursTraveled;

    double milesTraveled;

    hoursTraveled = minutesTraveled / 60.0;

    milesTraveled = hoursTraveled * milesPerHour;

    return milesTraveled;

    }

    int main (void) {

    double milesPerHour = 70.0;

    double minutesTraveled = 100.0;

    printf ("Miles: %lf/n", MphAndMinutesToMiles (milesPerHour, minutesTraveled));

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a function so that the main () code below can be replaced by the simpler code that calls function MphAndMinutesToMiles (). Original ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers