diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 2252640..f6e2ee4 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -21,9 +21,6 @@ const float CMAX = 49.5; const float CMIN = -62; //Set values for minimum and maximum temperatures. - - - float CtoF(float Fahrenheit, float Celsius) { Fahrenheit = (Celsius * 9.0 / 5.0) + 32.0; //Converts Celsius to Fahrenheit @@ -32,12 +29,15 @@ float CtoF(float Fahrenheit, float Celsius) { } + + + int main() { float Celsius = 0.0; //Defines Celsius for the conversion function float Fahrenheit = 0.0; //Defines Fahrenheit for the conversion function - Loop: + Loop: //Placeholder to loop back to cout << "Please enter a temperature between -62 and 49.5 degrees Celsius: \n"; cin >> Celsius; //Reads in Celsius from the user input @@ -46,7 +46,7 @@ int main() cout << Celsius << " Degrees Celsius is approximately " << CtoF(Fahrenheit, Celsius) << " Degrees Fahrenheit\n\n"; } else { - goto Loop; + goto Loop; //Goes back to placeholder to Loop in case of invalid response (past limits) } } |