Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2015 22:25
Show Gist options
  • Save anonymous/7aaa4eda8f259926e61a to your computer and use it in GitHub Desktop.
Save anonymous/7aaa4eda8f259926e61a to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/vuzeya
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
/*
1. THE FORTUNE TELLER
Why pay a fortune teller when you can just program your fortune yourself?
- Store the following into variables: number of children,
partner's name, geographic location, job title.
- Output your fortune to the screen like so: "You will be
a X in Y, and married to Z with N kids."
*/
var numberOfChildren = 3;
var name = "Joan";
var job = "programmer";
var lives = "Queens";
console.log( "You will be a " + job + " in " + lives);
/*
2. THE AGE CALCULATOR
Forgot how old someone is? Calculate it!
- Store the current year in a variable.
- Store their birth year in a variable.
- Calculate their 2 possible ages based on the stored values.
- Output them to the screen like so: "They are either NN or NN",
substituting the values.
*/
/*
3. THE LIFETIME SUPPLY SURVEY
Ever wonder how much a "lifetime supply" of your favorite snack is? Wonder no more!
- Store your current age into a variable.
- Store a maximum age into a variable.
- Store an estimated amount per day (as a number).
- Calculate how many you would eat total for the rest of your life.
- Output the result to the screen like so: "You will need NN to
last you until the ripe old age of X".
*/
</script>
<script id="jsbin-source-javascript" type="text/javascript">/*
1. THE FORTUNE TELLER
Why pay a fortune teller when you can just program your fortune yourself?
- Store the following into variables: number of children,
partner's name, geographic location, job title.
- Output your fortune to the screen like so: "You will be
a X in Y, and married to Z with N kids."
*/
var numberOfChildren = 3;
var name = "Joan";
var job = "programmer";
var lives = "Queens";
console.log( "You will be a " + job + " in " + lives);
/*
2. THE AGE CALCULATOR
Forgot how old someone is? Calculate it!
- Store the current year in a variable.
- Store their birth year in a variable.
- Calculate their 2 possible ages based on the stored values.
- Output them to the screen like so: "They are either NN or NN",
substituting the values.
*/
/*
3. THE LIFETIME SUPPLY SURVEY
Ever wonder how much a "lifetime supply" of your favorite snack is? Wonder no more!
- Store your current age into a variable.
- Store a maximum age into a variable.
- Store an estimated amount per day (as a number).
- Calculate how many you would eat total for the rest of your life.
- Output the result to the screen like so: "You will need NN to
last you until the ripe old age of X".
*/</script></body>
</html>
/*
1. THE FORTUNE TELLER
Why pay a fortune teller when you can just program your fortune yourself?
- Store the following into variables: number of children,
partner's name, geographic location, job title.
- Output your fortune to the screen like so: "You will be
a X in Y, and married to Z with N kids."
*/
var numberOfChildren = 3;
var name = "Joan";
var job = "programmer";
var lives = "Queens";
console.log( "You will be a " + job + " in " + lives);
/*
2. THE AGE CALCULATOR
Forgot how old someone is? Calculate it!
- Store the current year in a variable.
- Store their birth year in a variable.
- Calculate their 2 possible ages based on the stored values.
- Output them to the screen like so: "They are either NN or NN",
substituting the values.
*/
/*
3. THE LIFETIME SUPPLY SURVEY
Ever wonder how much a "lifetime supply" of your favorite snack is? Wonder no more!
- Store your current age into a variable.
- Store a maximum age into a variable.
- Store an estimated amount per day (as a number).
- Calculate how many you would eat total for the rest of your life.
- Output the result to the screen like so: "You will need NN to
last you until the ripe old age of X".
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment