
Lesson 8-4: Functions with Reference Parameters
Functions | 189
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Program MPH reads two real numbers, miles and hours, and prints milesPerHour
on the screen. Function GetData prompts the user for the appropriate values, reads them, and
returns them to function main.
// Program MPH reads miles and hours and prints miles
// per hour.
#include <iostream>
#include <iomanip>
using namespace std;
/* FILL IN the function prototype for GetData */
int main ()
{
float miles;
float hours;
float milesPerHour;
cout << fixed << showpoint; ...