Ask Question
11 August, 22:39

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. 12 August, 00:41
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers