diff options
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 781c362..2a1caf0 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -25,6 +25,20 @@ int main() cout << endl << endl << "Now please input the temperature: "; cin >> temperature; + if (input == "C") { + while (temperature < -62 || temperature > 49.5) { + cout << "That input is invalid." << endl << "Your value must be between -62 and 49.5." << endl; + cout << "Please input the temperature: "; + cin >> temperature; + } + } + else { + while (temperature < -80 || temperature > 121) { + cout << "That input is invalid." << endl << "Your value must be between -80 and 121." << endl; + cout << "Please input the temperature: "; + cin >> temperature; + } + } if (input == "C") { temperature *= 1.8; |