Skip to content

MADcruzer/js_review_lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

JSDR 213

2/15/23 JS Review Lab

Instructions :

Use Codepen or your code editor to complete these steps. Feel free to comment out the "Console.log()" portion of your code after each prompt so that you do not have too much going on on your screen!

Prompt 1 : Welcome Screen

Create a variable to store your First name, Last Name, and the day of the Week, then log a welcome message to your console that gives your name and tells you to have a nice Day, whichever day it is

Prompt 2 : Basic Math

Lionel Messi has scored 10 goals in World Cups, 15 in La Liga, and 18 in the Champions League. Set up a variable for each of these numbers, then create a new variable called totalGoals that adds them all together and logs the answer. Take it a step further by logging "Messi has scored __ goals", again using our string literals to put the information in

Prompt 3 : Colors Array

Create an array of 5 colors. Log the first item in the array, then using the length-1 feature, log the final item. Once we have those done, try to add new colors to the front and back of the array, and remove colors from both ends as well, logging your Color array data to the console with each step.

Prompt 4 : I95 Express

Create an array called newEnglandStates and add 3 states to it. Then create an array called midAtlantic and add 3 states to it. Next, create an array called southeastStates and add 3 states to it.

Use a spread operator to combine these 3 arrays together into an array called eastCoast.

Once we have 9 states in our East Coast, create a variable called theWest that takes 3 states from a westCoast array, and 3 from a southWest array using our spread operators.

Finally, add your eastCoast and theWest arrays together into an array called unitedStates, which should have at least 15 states in it.

Prompt 5: Pythagorean Theorum

Everyone's favorite high school subject! A right triangle has two sides, one 30 and one 40. Create a variable to store each of these legs, then create one called 'hypotenuse' that will use one of our magic Math methods to find its value, and log it to the console. (Feel free to check Google if you are unsure of the Pythagorean Theroum!)

Prompt 6: Temperature Converter

Create a variable called tempInCelcius, then run a math function to convert in into Farenheit. Once you have that working, do the reverse and create a tempInFarenheit variable, with a math function to convert to Celcius. Feel free to look up the equations to convert them, and remember, 0C = 32F, 100C = 212F, -40C = -40F

Prompt 7 : Century from Year

The first century AD goes from the year 0 to the year 99, while the 2nd century goes from the year 100 to 199, and so forth... the 20th century went from 1901 to 2000, with the 21st century going from 2001 to now.

Store a year as a variable, and then use your Math methods to convert this year into a century, which you will log to your console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published