-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShirt size
39 lines (38 loc) · 1.16 KB
/
Shirt size
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
var shirtWidth = 24;
var shirtLength = 32;
var shirtSleeve = 8.88;
if (
(18 <= shirtWidth && shirtWidth < 20) && (28 <= shirtLength && shirtLength < 29) && (8.13 <= shirtSleeve && shirtSleeve < 8.38))
{
console.log("S");
}
else if (
(20 <= shirtWidth && shirtWidth < 22) && (29 <= shirtLength && shirtLength < 30) && (8.38 <= shirtSleeve && shirtSleeve < 8.63))
{
console.log("M");
}
else if (
(22 <= shirtWidth && shirtWidth < 24) && (30 <= shirtLength && shirtLength < 31) && (8.63 <= shirtSleeve && shirtSleeve < 8.88))
{
console.log("L");
}
else if (
(24 <= shirtWidth && shirtWidth < 26) && (31 <= shirtLength && shirtLength < 33) && (8.88 <= shirtSleeve && shirtSleeve < 9.63))
{
console.log("XL");
}
else if (
(26 <= shirtWidth && shirtWidth < 28) && (33 <= shirtLength && shirtLength < 34) && (9.63 <= shirtSleeve && shirtSleeve < 10.13))
{
console.log("2XL");
}
else if (
(shirtWidth === 28) && (shirtLength === 34) && (shirtSleeve === 10.13))
/*or you could use
(28 <= shirtWidth && shirtWidth < 30) && (34 <= shirtLength && shirtLength < 36) && (10.13 <= shirtSleeve && shirtSleeve < 10.38))*/
{
console.log("3XL");
}
else {
console.log("N/A");
}