// Miles to Kilometers v. 3/29/06 // Write a C++ program to convert miles to kilometers. (Recall // that 1 mi = 1.6093440 km.) Your program should prompt the // user for miles and display the equivalent distance in kilo- // meters. // It should continuing prompting until the user enters a // negative value. #include // for cin and cout #include // for setw and setprecision int main () { double value; cout << "Convert miles to kilometers" << endl << endl; cout << "Enter a negative number to stop the program." << endl; cin >> value; while ( value >= 0 ) { cout << setw( 6 ) << value << " miles is " << setw( 8 ) << setprecision( 5 ) << value * 1.6093440 << endl; cout << "Enter another distance" << endl; cin >> value; } cout << "Thank you. Come again." << endl; return 0; }