From ec1cc916a57250ec51b57720e9e17de7643156b2 Mon Sep 17 00:00:00 2001 From: "smithbenjamin2022@gmail.com" Date: Wed, 9 Nov 2022 14:38:30 -0800 Subject: All ipnut logic done to my knowledge --- BlankConsoleLab/BlankConsoleLab.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; -- cgit v1.2.3