Hi all,
I'm trying to write the code for a program that will convert MPH to KPH and vice versa. Here is what I have so far....
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const double kph_to_mph = 0.6214;
int kph;
double mph = kph * kph_to_mph;
cout << "kilometers \tmiles\n";
cout << "per hour \tper hour\n\n";
cout << "========\t========\n\n";
cout << fixed << setprecision (1);
for ( int kph = 0; kph <= 150; kph +=5)
cout << setw (5) << kph << "\t\t" << mph << setw(5) << endl;
system("PAUSE");
return 0;
}
As of now, the table is not showing the correct conversions so any bit of help would be great. Thanks!