Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Programming Quiz: What do I Wear? (3-7)
  3.  */
  4.  
  5. // change the values of `shirtWidth`, `shirtLength`, and `shirtSleeve` to test your code
  6. var shirtWidth = 18;
  7. var shirtLength = 29;
  8. var shirtSleeve = 8.47;
  9.  
  10. // your code goes here
  11. if (
  12.     shirtWidth >= 18 &&
  13.     shirtWidth < 20 &&
  14.     shirtLength >= 28 &&
  15.     shirtLength < 29 &&
  16.     shirtSleeve >= 8.13 &&
  17.     shirtSleeve < 8.38
  18. ) {
  19.   console.log("P");
  20.  
  21. } else if (
  22.     shirtWidth >= 20 &&
  23.     shirtWidth < 22 &&
  24.     shirtLength >= 29 &&
  25.     shirtLength < 30 &&
  26.     shirtSleeve >= 8.38 &&
  27.     shirtSleeve < 8.63
  28. ) {
  29.   console.log("M");
  30.  
  31. } else if (
  32.     shirtWidth >= 22 &&
  33.     shirtWidth < 24 &&
  34.     shirtLength >= 30 &&
  35.     shirtLength < 31 &&
  36.     shirtSleeve >= 8.63 &&
  37.     shirtSleeve < 8.88
  38. ) {
  39.   console.log("L");
  40.  
  41. } else if (
  42.     shirtWidth >= 24 &&
  43.     shirtWidth < 26 &&
  44.     shirtLength >= 31 &&
  45.     shirtLength < 33 &&
  46.     shirtSleeve >= 8.88 &&
  47.     shirtSleeve < 9.63
  48. ) {
  49.   console.log("XL");
  50.  
  51. } else if (
  52.     shirtWidth >= 26 &&
  53.     shirtWidth < 28 &&
  54.     shirtLength >= 33 &&
  55.     shirtLength < 34 &&
  56.     shirtSleeve >= 9.63 &&
  57.     shirtSleeve < 10.13
  58. ) {
  59.   console.log("2XL");
  60.  
  61. } else if (
  62.     shirtWidth >= 28 &&
  63.     shirtLength >= 34 &&
  64.     shirtSleeve >= 10.13
  65. ) {
  66.   console.log("3XL");
  67.  
  68. } else {
  69.   console.log("N/A");
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement