diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index eee0f79..781c362 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -13,13 +13,21 @@ float temperature = 0; int main() { - cout << "Before you input a temperature value, you must first determine if it's in fahrendheit or celcius." << endl; - cout << "Please input 'F' for fahrendheit or 'C' for celcius: "; + cout << "Before you input a temperature value, you must first determine if it's in fahrenheit or celcius." << endl; + cout << "Please input 'F' for fahrenheit or 'C' for celcius: "; cin >> input; while (input != "F" && input != "C") { cout << "That input is invalid." << endl; cout << "Make sure your input is capitalized." << endl; - cout << "Please input 'F' for fahrendheit or 'C' for celcius: "; + cout << "Please input 'F' for fahrenheit or 'C' for celcius: "; cin >> input; } + + cout << endl << endl << "Now please input the temperature: "; + cin >> temperature; + + if (input == "C") { + temperature *= 1.8; + temperature += 32; + } }
\ No newline at end of file |