Ask Question
Today, 14:38

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

+4
Answers (1)
  1. Today, 16:18
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers