Created
December 6, 2020 04:39
-
-
Save mattsegura/d76add25b59e93f57354545e8aa1b607 to your computer and use it in GitHub Desktop.
Intilization and test will have max and min, Initilization with min and test with max
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
using namespace std; | |
int main() | |
{ | |
// constants | |
const int START_KPH = 60, | |
END_KPH = 130, | |
INCREMENT = 10; | |
// CONSTANT FOR SPEED CONVERSION | |
const double CONVERSION_FACTOR = 0.6214; | |
int kphap | |
; | |
double mph; | |
// set the numeric output format | |
cout << fixed << showpoint << setprecision(1); | |
// display | |
cout << "KPH\tMPH\t"; | |
cout << "---------\n"; | |
// display speeds. | |
for (kph = START_KPH; kph <= END_KPH; kph += INCREMENT) | |
{ | |
// calculate mph | |
mph = kph * CONVERSION_FACTOR; | |
// display the speeds in kph and mph | |
cout << kph << "\t" << mph << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment