Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementAdvancedExercise/02.SummerOutfit

Jan 24th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.02 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp18
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int degrees = int.Parse(Console.ReadLine());
  10.             string timeOfDay = Console.ReadLine();
  11.             string outfit = "";
  12.             string shoes = "";
  13.  
  14.             if (degrees >= 10 && degrees <= 18)
  15.             {
  16.                 if (timeOfDay == "Morning")
  17.                 {
  18.                     outfit = "Sweatshirt";
  19.                     shoes = "Sneakers";
  20.                 }
  21.                 else if (timeOfDay == "Afternoon" || timeOfDay == "Evening")
  22.                 {
  23.                     outfit = "Shirt";
  24.                     shoes = "Moccasins";
  25.                 }
  26.                 Console.WriteLine($"It's {degrees} degrees, get your {outfit} and {shoes}.");
  27.             }
  28.  
  29.             else if (degrees > 18 && degrees <= 24)
  30.             {
  31.                 if (timeOfDay == "Morning" || timeOfDay == "Evening")
  32.                 {
  33.                     outfit = "Shirt";
  34.                     shoes = "Moccasins";
  35.                 }
  36.                 else if (timeOfDay == "Afternoon")
  37.                 {
  38.                     outfit = "T-Shirt";
  39.                     shoes = "Sandals";
  40.                 }
  41.                 Console.WriteLine($"It's {degrees} degrees, get your {outfit} and {shoes}.");
  42.             }
  43.  
  44.             else if (degrees >= 25)
  45.             {
  46.                 if (timeOfDay == "Morning")
  47.                 {
  48.                     outfit = "T-Shirt";
  49.                     shoes = "Sandals";
  50.                 }
  51.                 else if (timeOfDay == "Afternoon")
  52.                 {
  53.                     outfit = "Swim Suit";
  54.                     shoes = "Barefoot";
  55.                 }
  56.                 else if (timeOfDay == "Evening")
  57.                 {
  58.                     outfit = "Shirt";
  59.                     shoes = "Moccasins";
  60.                 }
  61.                 Console.WriteLine($"It's {degrees} degrees, get your {outfit} and {shoes}.");
  62.             }
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement