-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise02.SummerOutfit.js
More file actions
39 lines (34 loc) · 1.13 KB
/
Exercise02.SummerOutfit.js
File metadata and controls
39 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function summerOutfit(degrees, timeOfDay){
let outfit = ``;
let shoes = ``;
if (degrees >= 10 && degrees <= 18){
if (timeOfDay === `Morning`){
outfit = `Sweatshirt`;
shoes = `Sneakers`;
} else if (timeOfDay === `Afternoon` || timeOfDay === `Evening`){
outfit = `Shirt`;
shoes = `Moccasins`;
}
} else if (degrees <= 24){
if (timeOfDay === `Afternoon`){
outfit = `T-Shirt`;
shoes = `Sandals`;
} else if (timeOfDay === `Morning` || timeOfDay === `Evening`){
outfit = `Shirt`;
shoes = `Moccasins`;
}
} else {
if (timeOfDay === `Morning`){
outfit = `T-Shirt`;
shoes = `Sandals`;
} else if (timeOfDay === `Afternoon`){
outfit = `Swim Suit`;
shoes = `Barefoot`;
} else if (timeOfDay === `Evening`){
outfit = `Shirt`;
shoes = `Moccasins`;
}
}
console.log(`It's ${degrees} degrees, get your ${outfit} and ${shoes}.`);
}
summerOutfit(16, `Morning`);