Advertisement
Spocoman

02. Summer Outfit

Sep 5th, 2023
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double gradus;
  7.     cin >> gradus;
  8.  
  9.     string timeOfDay;
  10.     cin >> timeOfDay;
  11.  
  12.     string outfit = "Shirt";
  13.     string shoes = "Moccasins";
  14.  
  15.     if (timeOfDay == "Morning") {
  16.         if (gradus >= 10 && gradus <= 18) {
  17.             outfit = "Sweatshirt";
  18.             shoes = "Sneakers";
  19.         }
  20.         else if (gradus > 24) {
  21.             outfit = "T-Shirt";
  22.             shoes = "Sandals";
  23.         }
  24.     }
  25.     else if (timeOfDay == "Afternoon") {
  26.         if (gradus > 18 && gradus <= 24) {
  27.             outfit = "T-Shirt";
  28.             shoes = "Sandals";
  29.         }
  30.         else if (gradus > 24) {
  31.             outfit = "Swim Suit";
  32.             shoes = "Barefoot";
  33.         }
  34.     }
  35.  
  36.     cout << "It\'s " << gradus << " degrees, get your " << outfit << " and " << shoes << "." << endl;
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement