diff options
| author | Connor McDowell <[email protected]> | 2024-01-27 16:26:25 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-01-27 16:26:25 -0800 |
| commit | 4d061ecc7689dd703853532aee4b84e8fb124866 (patch) | |
| tree | 45dcf43b388f0d4c0fd813c24c0b77be53cafbf3 /homework2/homework2.cpp | |
| parent | fixed unsafe use of bool type (diff) | |
| download | homework-2-connormcdowell275-4d061ecc7689dd703853532aee4b84e8fb124866.tar.xz homework-2-connormcdowell275-4d061ecc7689dd703853532aee4b84e8fb124866.zip | |
test (remove function)
Diffstat (limited to 'homework2/homework2.cpp')
| -rw-r--r-- | homework2/homework2.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/homework2/homework2.cpp b/homework2/homework2.cpp index 5c038a7..d45a4e6 100644 --- a/homework2/homework2.cpp +++ b/homework2/homework2.cpp @@ -37,7 +37,38 @@ int main() cin >> cel; - float CtoF(int cel); + //float CtoF(int cel); + float num = (cel * (9.0 / 5.0)) + 32; + + if (0 < num && num < 32) + { + std::cout << "The temperature: " << num << " fahrenheit, is cold enough that water freezes! brrr!"; + } + + if (33 < num && num < 65) + { + std::cout << "The temperature: " << num << " fahrenheit, is quite chilly! bring a sweater"; + } + + if (66 < num && num < 76) + { + std::cout << "The temperature: " << num << " fahrenheit, is around room temperature and quite comfortable"; + } + + if (78 < num && num < 88) + { + std::cout << "The temperature: " << num << " fahrenheit, is pretty warm! drink plenty of water and stay in the shade when you can."; + } + + if (89 < num && num < 100) + { + std::cout << "The temperature: " << num << " fahrenheit, is very hot, wear sunscreen and hydrate often if going out."; + } + + if (num > 101) + { + std::cout << "The temperature: " << num << " fahrenheit, do not even think about leaving the house."; + } } } |