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