rendered paste body#include <iostream>
using namespace std;
int main ()
{
int mph, hours, distance;
mph = 0;
while ( mph <= 0 )
{
cout <<"What is the speed of the vehicle in mph? ";
cin >> mph;
if (mph < 0) cout << "You suck. Enter a real speed." << endl;
}
hours = 0;
while ( hours <= 0 )
{
cout <<"How many hours has it travelled? ";
cin >> hours;
if (mph < 0) cout << "You suck. Enter a real amount of time." << endl;
}
cout << "Hour Distance" << endl;
cout <<"---------------------------------------------" <<endl;
for ( int counter = 1; counter <= hours; counter++ )
{
distance = mph * counter;
cout << counter <<" " << distance <<endl;
}
cout << "Hour Distance" << endl;
cout <<"---------------------------------------------" <<endl;
return 0;
}