SHARE
TWEET

SummerOutfit

IvaAnd Feb 27th, 2020 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class SummerOutFit_Short {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int degrees = Integer.parseInt(scanner.nextLine());
  8.         String dayTime = scanner.nextLine();
  9.         String outfit = "";
  10.         String shoes = "";
  11.  
  12.         switch (dayTime) {
  13.  
  14.             case "Morning":
  15.                 if (degrees >= 10 && degrees <= 18) {
  16.                     outfit = "Sweatshirt";
  17.                     shoes = "Sneakers";
  18.                 } else if (degrees >= 25) {
  19.                     outfit = "T-Shirt";
  20.                     shoes = "Sandals";
  21.                 }
  22.                 break;
  23.             case "Afternoon":
  24.                 if (degrees > 18 && degrees <= 24) {
  25.                     outfit = "T-Shirt";
  26.                     shoes = "Sandals";
  27.                 } else if (degrees >= 25) {
  28.                     outfit = "Swim Suit";
  29.                     shoes = "Barefoot";
  30.                 }
  31.                 break;
  32.  
  33.             default:
  34.                 outfit = "Shirt";
  35.                 shoes = "Moccasins";
  36.  
  37.                 break;
  38.  
  39.         }
  40.         System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top