-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsummercloathing.js
62 lines (55 loc) · 2.11 KB
/
summercloathing.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Лято е с много променливо време и Виктор има нужда от вашата помощ.
// Напишете функция, която спрямо времето от денонощието и градусите да препоръча на Виктор какви дрехи да си облече.
// Вашия приятел има различни планове за всеки етап от деня, които изискват и различен външен вид, тях може да видите от таблицата.
// Време от денонощието / градуси
// Morning
// Afternoon
// Evening
// 10 <= градуси <= 18 Outfit = Sweatshirt
// Shoes = Sneakers Outfit = Shirt
// Shoes = Moccasins Outfit = Shirt
// Shoes = Moccasins
// 18 < градуси <= 24 Outfit = Shirt
// Shoes = Moccasins Outfit = T-Shirt
// Shoes = Sandals Outfit = Shirt
// Shoes = Moccasins
// градуси >= 25 Outfit = T-Shirt
// Shoes = Sandals Outfit = Swim Suit
// Shoes = Barefoot Outfit = Shirt
// Shoes = Moccasins
function summerOutfit(input) {
let degrees = Number(input[0]);
let timeOfDay = input[1];
let outfit = "";
let shoes = "";
if (degrees >= 10 && degrees <= 18) {
if (timeOfDay == "Morning") {
outfit = "Sweatshirt";
shoes = "Sneakers";
} else {
outfit = "Shirt";
shoes = "Moccasins";
}
} else if (degrees <= 24) {
if (timeOfDay == "Morning" || timeOfDay == "Evening") {
outfit = "Shirt";
shoes = "Moccasins";
} else {
outfit = "T-Shirt";
shoes = "Sandals";
}
} else {
if (timeOfDay == "Morning") {
outfit = "T-Shirt";
shoes = "Sandals";
} else if (timeOfDay == "Afternoon") {
outfit = "Swim Suit";
shoes = "Barefoot";
} else {
outfit = "Shirt";
shoes = "Moccasins";
}
}
console.log(`It's ${degrees} degrees, get your ${outfit} and ${shoes}.`);
}
summerOutfit(["22", "Afternoon"]);