diff options
| -rw-r--r-- | homework2/homework2.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/homework2/homework2.cpp b/homework2/homework2.cpp index 7486f10..4ade128 100644 --- a/homework2/homework2.cpp +++ b/homework2/homework2.cpp @@ -26,7 +26,44 @@ int main() cin >> fah; - float FtoC(float fah); + float num = (fah - 32) * (5 / 9); + + if (-8 < num && num < 5) + { + std::cout << "The temperature: " << num << " fahrenheit, is cold enough that water freezes! brrr!" << std::endl; + } + + if (6 < num && num < 15) + { + std::cout << "The temperature: " << num << " fahrenheit, is quite chilly! bring a sweater" << std::endl; + } + + if (15 < num && num < 24) + { + std::cout << "The temperature: " << num << " fahrenheit, is around room temperature and quite comfortable" << std::endl; + } + + if (25 < num && num < 30) + { + std::cout << "The temperature: " << num << " fahrenheit, is pretty warm! drink plenty of water and stay in the shade when you can." << std::endl; + } + + if (31 < num && num < 39) + { + std::cout << "The temperature: " << num << " fahrenheit, is very hot, wear sunscreen and hydrate often if going out." << std::endl; + } + + if (num > 40) + { + std::cout << "The temperature: " << num << " fahrenheit, do not even think about leaving the house." << std::endl; + } + #ifdef VERBOSE + { + std::cout << fah << " F to C" << std::endl; + std::cout << "C = (" << fah << " - 32) * (5/9)" << std::endl; + std::cout << "C = " << num << " " << std::endl; + } + #endif VERBOSE } // DONE |