Advertisement
blackswan01

Ice Cream Lesson

Nov 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. *
  2. * Programming Quiz: Ice Cream (3-6)
  3. *
  4. * Write a single if statement that logs out the message:
  5. *
  6. * "I'd like two scoops of __________ ice cream in a __________ with __________."
  7. *
  8. * ...only if:
  9. * - flavor is "vanilla" or "chocolate"
  10. * - vessel is "cone" or "bowl"
  11. * - toppings is "sprinkles" or "peanuts"
  12. *
  13. * We're only testing the if statement and your boolean operators.
  14. * It's okay if the output string doesn't match exactly.
  15. */
  16.  
  17. // change the values of `flavor`, `vessel`, and `toppings` to test your code
  18.  
  19. var flavor = "coconut";
  20. var vessel = "bowl";
  21. var toppings = "peanuts";
  22.  
  23. if ((flavor == "vannilia" || flavor == "chocolate") && (vessel == "cone" || vessel == "bowl") && (toppings == "sprinkles" || toppings == "peanuts"));
  24. console.log("I'd like two scoops of " + flavor + " ice cream in a " + vessel + " with " + toppings + ".");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement