Question: Program 3 Objective: you will write a C + + program to convert the running speed from different formats to miles per hour ( MPH

Program 3 Objective: you will write a C++ program to convert the running speed from different
formats to miles per hour (MPH). You will create an overloaded function named convertToMPH to
handle two types of inputs: pace in minutes and seconds per mile, and speed in kilometers per
hour (KPH). The goal is to implement these conversions in a function and test them using a driver
program.
Background:
Runners often measure their speed in pace (minutes and seconds per mile) or in kilometers per
hour. To compare speeds, it is useful to convert these measurements to a common unit, such as
miles per hour. The conversion factors you'll need are:
1 mile is approximately 1.61 kilometers.
Task:
Overloaded Function convertToMPH:
The first version of convertToMPH should take two integers as parameters (minutes and
seconds per mile) and return the speed in MPH as a double.
The second version of convertToMPH should take one double as a parameter (speed in
KPH and return the speed in MPH as a double.
Instructions:
Implement the first convertToMPH function to calculate MPH from minutes and seconds
per mile. Use the formula:
minutes+seconds/60)
Implement the second convertToMPH function to convert KPH to MPH. Use the formula:
mile/1.61 kilometers)
Include appropriate prompts and input handling in your driver program to allow the user to
test both conversion methods.
Ensure your program includes comments to explain the functionality of the code and each
function.
Output the results clearly, showing both the input values and the calculated MPH.
Submit your C++ source code file along with screenshots of the output for the specified
tests.
Specific Inputs for Submission:
Test your functions with a pace of 5 minutes and 30 seconds per mile.
Test your functions with a speed of 12KPH.
Program 3 Objective: you will write a C + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!