Advertisement
CR7CR7

SumerOutfit

Apr 13th, 2023
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  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.  
  7.         int degrees = Integer.parseInt(scanner.nextLine());
  8.         String timeOfDay = scanner.nextLine();
  9.  
  10.         String clothes = "";
  11.         String shoes = "";
  12.  
  13.         if (degrees >= 10 && degrees <= 18) {
  14.             if (timeOfDay.equals("Morning")) {
  15.                 clothes = "Sweatshirt";
  16.                 shoes = "Sneakers";
  17.             } else if (timeOfDay.equals("Afternoon") || timeOfDay.equals("Evening")) {
  18.                 clothes = "Shirt";
  19.                 shoes = "Moccasins";
  20.             }
  21.         } else if (degrees > 18 && degrees <= 24) {
  22.             if (timeOfDay.equals("Morning")) {
  23.                 clothes = "Shirt";
  24.                 shoes = "Moccasins";
  25.             } else if (timeOfDay.equals("Afternoon")) {
  26.                 clothes = "T-Shirt";
  27.                 shoes = "Sandals";
  28.             } else if (timeOfDay.equals("Evening")) {
  29.                 clothes = "Shirt";
  30.                 shoes = "Moccasins";
  31.             }
  32.         } else if (degrees >= 25) {
  33.             if (timeOfDay.equals("Morning") || timeOfDay.equals("Afternoon")) {
  34.                 clothes = "T-Shirt";
  35.                 shoes = "Sandals";
  36.             } else if (timeOfDay.equals("Evening")) {
  37.                 clothes = "Shirt";
  38.                 shoes = "Moccasins";
  39.             }
  40.         }
  41.  
  42.         System.out.printf("It's %d degrees, get your %s and %s.", degrees, clothes, shoes);
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement