SHARE
TWEET

Untitled

a guest Jun 24th, 2019 70 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 celsius = Integer.parseInt(scanner.nextLine());
  7.         String dayTime = scanner.nextLine();
  8.         String outfit = null;
  9.         String shoes = null;
  10.  
  11.         if ("Morning".equals(dayTime)) {
  12.             if (celsius >= 10 && celsius <= 18) {
  13.                 outfit = "Sweatshirt";
  14.                 shoes = "Sneakers";
  15.             } else if (celsius > 18 && celsius <= 24) {
  16.                 outfit = "Shirt";
  17.                 shoes = "Moccasins";
  18.             } else if (celsius >= 25) {
  19.                 outfit = "T-Shirt";
  20.                 shoes = "Sandals";
  21.             }
  22.         } else if ("Afternoon".equals(dayTime)) {
  23.             if (celsius >= 10 && celsius <= 18) {
  24.                 outfit = "Shirt";
  25.                 shoes = "Moccasins";
  26.             } else if (celsius > 18 && celsius <= 24) {
  27.                 outfit = "T-Shirt";
  28.                 shoes = "Sandals";
  29.             } else if (celsius >= 25) {
  30.                 outfit = "Swim Suit";
  31.                 shoes = "Barefoot";
  32.             }
  33.         } else if ("Evening".equals(dayTime)){
  34.             if (celsius >= 10 && celsius <= 18) {
  35.                 outfit = "Shirt";
  36.                 shoes = "Moccasins";
  37.             } else if (celsius > 18 && celsius <= 24) {
  38.                 outfit = "Shirt";
  39.                 shoes = "Moccasins";
  40.             } else if (celsius >= 25) {
  41.                 outfit = "Shirt";
  42.                 shoes = "Moccasins";
  43.             }
  44.             }
  45.         System.out.printf("It's %d degrees, get your %s and %s.", celsius, outfit, shoes);
  46.         }
  47. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top