diff options
| author | [email protected] <[email protected]> | 2022-11-09 14:38:30 -0800 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2022-11-09 14:38:30 -0800 |
| commit | ec1cc916a57250ec51b57720e9e17de7643156b2 (patch) | |
| tree | 27340e4b593a4bf12b6b1ce7d1958720770b65fc /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | More Stuff has been Done (diff) | |
| download | cst116-lab2-smith-benjamin-ec1cc916a57250ec51b57720e9e17de7643156b2.tar.xz cst116-lab2-smith-benjamin-ec1cc916a57250ec51b57720e9e17de7643156b2.zip | |
All ipnut logic done to my knowledge
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -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; |