Advertisement
Guest User

Untitled

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