Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Created August 20, 2017 20:50
Show Gist options
  • Save claudiainbytes/edc0cd26e7ab8c7e5ed1b8cc135f0456 to your computer and use it in GitHub Desktop.
Save claudiainbytes/edc0cd26e7ab8c7e5ed1b8cc135f0456 to your computer and use it in GitHub Desktop.
Ice Cream Quiz
/*
* Programming Quiz: Ice Cream (3-6)
*
* Write a single if statement that logs out the message:
*
* "I'd like two scoops of __________ ice cream in a __________ with __________."
*
* ...only if:
* - flavor is "vanilla" or "chocolate"
* - vessel is "cone" or "bowl"
* - toppings is "sprinkles" or "peanuts"
*/
// change the values of `flavor`, `vessel`, and `toppings` to test your code
var flavor = "vanilla";
var vessel = "cone";
var toppings = "sprinkles";
// Add your code here
if ((( flavor === "vanilla") || (flavor === "chocolate")) &&
((vessel === "cone") || (vessel === "bowl")) &&
(( toppings === "sprinkles") || ( toppings === "peanuts")) ) {
console.log("I'd like two scoops of " + flavor + " ice cream in a " + vessel + " with " + toppings+ ".");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment