Last active
December 17, 2022 04:15
-
-
Save desinas/cb331ddc8b98384c5d72745c1c1476b2 to your computer and use it in GitHub Desktop.
What do I wear Quiz (3-7) of Udacity Front end developer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Programming Quiz: What do I Wear? (3-7) | |
*/ | |
// change the values of `shirtWidth`, `shirtLength`, and `shirtSleeve` to test your code | |
var shirtWidth = 23; | |
var shirtLength = 30; | |
var shirtSleeve = 8.71; | |
// your code goes here | |
if ((shirtWidth >= 18 && shirtWidth < 20) | |
&& (shirtLength >= 28 && shirtLength < 29) | |
&& (shirtSleeve >= 8.13 && shirtSleeve < 8.38)) { | |
console.log("S"); | |
} else if ((shirtWidth >= 20 && shirtWidth < 22) | |
&& (shirtLength >= 29 && shirtLength < 30) | |
&& (shirtSleeve >= 8.38 && shirtSleeve < 8.63)) { | |
console.log("M"); | |
} else if ((shirtWidth >= 22 && shirtWidth < 24) | |
&& (shirtLength >= 30 && shirtLength < 31) | |
&& (shirtSleeve >= 8.63 && shirtSleeve < 8.88)) { | |
console.log("L"); | |
} else if ((shirtWidth >= 24 && shirtWidth < 26) | |
&& (shirtLength >= 31 && shirtLength < 33) | |
&& (shirtSleeve >= 8.88 && shirtSleeve < 9.63)) { | |
console.log("XL"); | |
} else if ((shirtWidth >= 26 && shirtWidth < 28) | |
&& (shirtLength >= 33 && shirtLength < 34) | |
&& (shirtSleeve >= 9.63 && shirtSleeve < 10.13)) { | |
console.log("2XL"); | |
} else if (shirtWidth >= 28 && shirtLength >= 34 && shirtSleeve >= 10.13) { | |
console.log("3XL"); | |
} else console.log("N/A"); |
Author
desinas
commented
Dec 15, 2017
What Went Well
- Your code should have a variable shirtWidth
- Your code should have a variable shirtLength
- Your code should have a variable shirtSleeve
- Your code should include an if...else statement
- Your code should use logical expressions
- Your code should produce the expected output
Feedback: Your answer passed all our tests! Awesome job!
The quiz will ask you questions about CSS, HTML5, JavaScript, and other topics that are important to learning front end development. You'll have time to answer each question before moving on to the next one, so take your time and try not to skip any questions. If you finish all of the questions before time runs out, scroll down to review your answers before moving on to the next section of the quiz. For SX Vegas Casino Login reviews I prefer visiting https://casinosanalyzer.com/online-casinos/sxvegas.com website because it helps you to find the right platform for your casino journey.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment