Permalink
Browse files

Initial commit

  • Loading branch information...
jmeade11 committed Feb 13, 2020
0 parents commit 4ec8b8dd7aeec8f494e466f6b21a1c6711bf71b2
Showing with 40 additions and 0 deletions.
  1. +11 −0 99-bottles-of-beer/index.js
  2. +19 −0 fizzbuzz/index.js
  3. +10 −0 random-addresses/index.js
@@ -0,0 +1,11 @@
/*
Write a script that prints the lyrics to "99 Bottles of Beer on the Wall" in the terminal.
If you're unfamiliar with the song, you can [find the lyrics here](http://www.99-bottles-of-beer.net/lyrics.html).
Be sure that all of your output includes proper spacing (no words or values running into each other).
Hint: You can make your output appear on multiple lines by using the string \n to insert a line break.
For an extra challenge, improve this code to print "1 bottle" rather than "1 bottles." (Hint: read up on if/else
conditional statements at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else).
*/
@@ -0,0 +1,19 @@
// Relying on your newfound knowledge of loops, combine loops and if/else statements together and incrementally build the common fizzbuzz loop.

// - In the loop, every time a number is divisible by **3**, instead of logging the number itself, the word "fizz" should appear.
// - If the number is divisible by **5**, the word "buzz" should be logged.
// - If the number is divisible by both **3** and **5**, then the word "fizzbuzz" should be logged.

// Follow the steps below.

// ##### Step 1:
// Construct a for loop that iterates through, and `console.log()`'s out, numbers 1 - 100.

// ##### Step 2:
// Add an `if/else` statement that logs the string `"fizz"` if the value being iterated over is divisible by `3`; otherwise, log out the value.

// ##### Step 3:
// Add an `else if` clause that logs the string `"buzz"` if the value being iterated over is divisible by `5`.

// ##### Step 4:
// Add an additional `else if` clause that logs the string `"fizzbuzz"` if the value being iterated over is divisible by both `3` and `5`.
@@ -0,0 +1,10 @@
/*
Optional bonus work on conditionals and functions:
Write a script that can generate random addresses
As a first step, create arrays that contain dummy data for each of the following: street number, street name, city name, state name, and zip code
Your script should randomly select one item from each of these arrays and then use them to construct a random address
Each time you load or reload the page in a browser, your program should print a new randomly-generated address to the terminal. For example:
34578 Dolphin Street, Wonka NY, 44506
*/

0 comments on commit 4ec8b8d

Please sign in to comment.