Skip to content

Instantly share code, notes, and snippets.

@leecameron
leecameron / checking-balance
Last active December 4, 2017 08:21
Google scholarship, JavaScript, conditionals, checking balance quiz
/*
* Programming Quiz - Checking Your Balance (3-5)
*/
// change the values of `balance`, `checkBalance`, and `isActive` to test your code
var balance = -100.00;
var checkBalance = true;
var isActive = true;
// your code goes here
@leecameron
leecameron / what-do-wear
Last active December 4, 2017 08:20
Google Scholarship, JavaScript, conditionals, what do I wear quiz
/*
* Programming Quiz: What do I Wear? (3-7)
*/
// change the values of `shirtWidth`, `shirtLength`, and `shirtSleeve` to test your code
var shirtWidth = 19;
var shirtLength = 28.5;
var shirtSleeve = 8.2;
// your code goes here
@leecameron
leecameron / ice-cream
Last active December 4, 2017 08:19
Google scholarship, JavaScript, conditionals, 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"
@leecameron
leecameron / food-chain
Last active December 4, 2017 08:17
Google scholarship, JavaScript, conditionals, navigating the food chain quiz
/*
* Programming Quiz - Navigating the Food Chain (3-8)
*
* Use a series of ternary operator to set the category to one of the following:
* - "herbivore" if an animal eats plants
* - "carnivore" if an animal eats animals
* - "omnivore" if an animal eats plants and animals
* - undefined if an animal doesn't eat plants or animals
*
* Notes
@leecameron
leecameron / back-to-school
Last active December 4, 2017 08:16
Google scholarship, JavaScript, conditionals, back to school quiz.
/*
* Programming Quiz: Back to School (3-9)
*/
// change the value of `education` to test your code
var education = "a Doctoral degree";
// set the value of this based on a person's education
var salary = "";
@leecameron
leecameron / julia-james
Created December 4, 2017 08:06
Google scholarship, JavaScript, Loops, JuliaJames Quiz
/*
* Programming Quiz: JuliaJames (4-1)
*/
// check divisibility
// print Julia, James, or JuliaJames
// increment x
var x = 1;
while (x <= 20 /* your stop condition goes here */) {
@leecameron
leecameron / even-odd
Created December 4, 2017 09:50
Google scholarship, JavaScript, conditionals, even or odd quiz
/*
* Programming Quiz: Even or Odd (3-2)
*
* Write an if...else statement that prints `even` if the
* number is even and prints `odd` if the number is odd.
*
* Note - make sure to print only the string "even" or the string "odd"
*/
// change the value of `number` to test your if...else statement
@leecameron
leecameron / musical-groups
Created December 4, 2017 09:51
Google scholarship, JavaScript, conditionals, musical groups quiz
/*
* Programming Quiz: Musical Groups (3-3)
*/
// change the value of `musicians` to test your conditional statements
var musicians = 6;
// your code goes here
if (musicians > 4) {
console.log("this is a large group");
@leecameron
leecameron / murder-mystery
Created December 4, 2017 09:53
Google scholarship, JavaScript, conditionals, murder mystery quiz
/*
* Programming Quiz: Murder Mystery (3-4)
*/
// change the value of `room` and `suspect` to test your code
var room = "ballroom";
var suspect = "Mr. Kalehoff";
var weapon = "";
var solved = false;
@leecameron
leecameron / 99-bottles-of-juice
Created December 4, 2017 12:04
Google scholarship, JavaScript, Loops, 99 bottles of juice quiz
/*
* Programming Quiz: 99 Bottles of Juice (4-2)
*
* Use the following `while` loop to write out the song "99 bottles of juice".
* Log the your lyrics to the console.
*
* Note
* - Each line of the lyrics needs to be logged to the same line.
* - The pluralization of the word "bottle" changes from "2 bottles" to "1 bottle" to "0 bottles".
*/