Advertisement
DraconiusNX

Untitled

Sep 25th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function summerOutfit(data) {
  2.     var temp = Number (data[0]);
  3.     var time =  data[1];
  4.     var outfit = 0;
  5.     var shoes = 0;
  6.  
  7.     if (temp >= 10 && temp <= 18) {
  8.         if (time === "Morning") {
  9.             outfit = "Sweatshirt";
  10.             shoes = "Sneakers";
  11.         } else {
  12.             outfit = "Shirt";
  13.             shoes = "Moccasins";
  14.         }
  15.     } else if (temp > 18 && temp <= 24) {
  16.         if (time === "Morning") {
  17.             outfit = "Shirt";
  18.             shoes = "Moccasins";
  19.         } else if (time === "Afternoon") {
  20.             outfit = "T-Shirt";
  21.             shoes = "Sandals";
  22.         } else {
  23.             outfit = "Shirt";
  24.             shoes = "Moccasins";
  25.         }
  26.     } else {
  27.         if (time === "Morning") {
  28.             outfit = "T-Shirt";
  29.             shoes = "Sandals";
  30.         } else if (time === "Afternoon") {
  31.             outfit = "Swinsuit";
  32.             shoes = "Barefoot";
  33.         } else {
  34.             outfit = "Shirt";
  35.             shoes = "Moccasins";
  36.         }
  37.     }
  38.     console.log(`It's ${temp} degrees, get your ${outfit} and ${shoes}.`)
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement