SvetlanPetrova

Summer Outfit SoftUni

Apr 15th, 2021
922
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class SummerOutfit {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int degrees = Integer.parseInt(scanner.nextLine());
  7.         String timeOfDay = scanner.nextLine();
  8.  
  9.         String outfit = "";
  10.         String shoes = "";
  11.  
  12.  
  13.         switch (timeOfDay) {
  14.             case "Morning":
  15.                 if (degrees >= 10 && degrees <= 18) {
  16.                     outfit = "Sweatshirt";
  17.                     shoes = "Sneakers";
  18.                 } else if (degrees > 18 && degrees <= 24) {
  19.                     outfit = "Shirt";
  20.                     shoes = "Moccasins";
  21.                 } else if (degrees >= 25) {
  22.                     outfit = "T-Shirt";
  23.                     shoes = "Sandals";
  24.                 }
  25.                 break;
  26.             case "Afternoon":
  27.                 if (degrees >= 10 && degrees <= 18) {
  28.                     outfit = "Shirt";
  29.                     shoes = "Moccasins";
  30.                 } else if (degrees > 18 && degrees <= 24) {
  31.                     outfit = "T-Shirt";
  32.                     shoes = "Sandals";
  33.                 } else if (degrees >= 25) {
  34.                     outfit = "Swim Suit";
  35.                     shoes = "Barefoot";
  36.                 }
  37.                 break;
  38.             case "Evening":
  39.                 outfit = "Shirt";
  40.                 shoes = "Moccasins";
  41.                 break;
  42.         }
  43.  
  44.          System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
  45.  
  46.     }
  47. }
  48.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×