Advertisement
Guest User

LqtnoObleklo

a guest
Oct 1st, 2019
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SummerOutfit {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int degrees = Integer.parseInt(scan.nextLine());
  8.         String time = scan.nextLine();
  9.  
  10.         String outfit ="";
  11.         String shoes ="";
  12.  
  13.         if ("Morning".equals(time)) {
  14.             if (degrees >= 10 && degrees <= 18) {
  15.                 outfit = "Sweatshirt";
  16.                 shoes = "Sneakers";
  17.             } else if (degrees > 18 && degrees <= 24) {
  18.                 outfit = "Shirt";
  19.                 shoes = "Moccasins";
  20.             } else  {
  21.                 outfit = "T-Shirt";
  22.                 shoes = "Sandals";
  23.             }
  24.         }else if ("Afternoon".equals(time)) {
  25.             if (degrees >= 10 && degrees <= 18) {
  26.                 outfit = "Shirt";
  27.                 shoes = "Moccasins";
  28.             } else if (degrees > 18 && degrees <= 24) {
  29.                 outfit = "T-Shirt";
  30.                 shoes = "Sandals";
  31.             } else {
  32.                 outfit = "Swim suit";
  33.                 shoes = "Barefoot";
  34.             }
  35.         }else if ("Evening".equals(time)) {
  36.             if (degrees >= 10 && degrees <= 18) {
  37.                 outfit = "Shirt";
  38.                 shoes = "Moccasins";
  39.             } else if (degrees > 18 && degrees <= 24) {
  40.                 outfit = "Shirt";
  41.                 shoes = "Moccasins";
  42.             } else {
  43.                 outfit = "Shirt";
  44.                 shoes = "Moccasins";
  45.             }
  46.  
  47.  
  48.         }
  49.         System.out.printf("It's %d degrees, get your %s and %s.",degrees,outfit,shoes);
  50.  
  51.  
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement