Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Degrees {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int gradus = Integer.parseInt(scanner.nextLine());
- String timeOfDay = scanner.nextLine();
- String outfit = "";
- String shoes = "";
- if ("Morning".equals(timeOfDay)) {
- if (gradus >= 10 && gradus <= 18) {
- outfit = "Sweatshirt";
- shoes = "Sneakers";
- } else if (gradus > 18 && gradus <= 24) {
- outfit = "Shirt";
- shoes = "Moccasins";
- } else {
- outfit = "T-Shirt";
- shoes = "Sandals";
- }
- }
- if ("Afternoon".equals(timeOfDay)) {
- if (gradus >= 10 && gradus <= 18) {
- outfit = "Shirt";
- shoes = "Moccasins";
- } else if (gradus > 18 && gradus <= 24) {
- outfit = "T- Shirt";
- shoes = "Sandals";
- } else {
- outfit = "Swim Suit";
- shoes = "Barefoot";
- }
- }
- if ("Evening".equals(timeOfDay)) {
- outfit = "shirt";
- shoes = "Moccasins";
- }
- System.out.printf("It %d, get your %s and %s", gradus, outfit, shoes);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement