// Program 2.25: Declares distance of an object
// given speed in MPH and time in hours and minutes
// Author: Eric Martin
// Date: 10/1/2004
#include <string>
#include <iostream>
#include <getch>
using namespace std;
float main ()
{
// Declare speed in MPH
// Declare time in hours and minutes
// Formulate
float speed;
float time;
float distance;
int char;
cout << "Compute distance traveled given speed and time" <<
endl;
cout << "Enter speed in MPH: ";
cin >> speed;
cout << "Enter time in hours and minutes: ";
cin>> time;
distance = speed / time;
cout << "It takes " << time << " minutes to travel "
<< distance << " miles at "
<< speed << " miles per hour" << endl;
int char;
return 0;
}
What do I need to include in this program in order to keep it from closing after getting the result? Someone suggested getch, but the compiler says the file does not exist... :?: