Skip to content

Instantly share code, notes, and snippets.

@mackenco
Created March 14, 2017 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackenco/371a00b0f5cab1bf7052c2972f9617e6 to your computer and use it in GitHub Desktop.
Save mackenco/371a00b0f5cab1bf7052c2972f9617e6 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=371a00b0f5cab1bf7052c2972f9617e6
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
{"enabledLibraries":["jquery"]}
/*
#1 The biggest of three: Write a function called "bigThree" that takes three numbers as parameters x, y, and z and console.log's which of the three is the largest.
*/
/*
#2 Percentage: Write a function called "percent" that takes two numbers as parameters x and y, and console.log's the percentage. Example: "5 is 50% of 10."
*/
/*
#3 Circle functions: For this you'll write three functions.
1) A function called circumference that takes a radius as a parameter and console.log's a circle's circumference.
2) A function called area that takes a radius as a parameter and console.log's a circle's area
3) A function called circleStats that takes a radius as a parameter and console.log's a circle's circumference AND area. Hint - don't do too much work for this one ;)
*/
/*
#4 What's the type: Write a function called "type" that takes a parameter called "thing" and console.log's the type of the thing (string, number, etc)
*/
/*
#5 Positive or not: Write a function called "sign" that takes three numbers as parameters x, y, and z. Console.log whether the sign of the product of all three is positive(+) or negative(-).
Example: "The sign of 3, -7, and 2 is -"
*/
/*
#6 What's the grade: Write a function called "grade" that takes a number as a parameter and console.log's what grade it is. Example: "97 is an A." What if someone puts in a number that doesn't make sense?
*/
/*
#7 Temperature conversion: Write a function that takes a temperature in farenheit as a parameter and console.log's the temperature in celsius. What if someone puts in a string instead of a number?
http://www.rapidtables.com/convert/temperature/how-fahrenheit-to-celsiu.htm
*/
/*
#8 Random: Write a function that takes a number as a parameter and console.logs a random number between 0 and the parameter. You will need to Google Math.random() (and possibly Math.round());
*/
/*
#9 Shape draw: Write a function that takes three parameters: a height (number), a width (number), and a color (string). Use jQuery to draw a rectangle with the given height, width, and background color.
*/
/*
#10 Random square: Use the function you wrote in #8 and the function you wrote in #9 to draw shapes with random heights and widths.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment