This 5 challenge review covers core JavaScript concepts and is expected to take Students 1.5 hr or less
- Create a new public GitHub repository called
javascript-concept-review-level-3 - Clone repository and copy the contents of this README file to your README
- Create
index.html,style.css, andmain.jsfiles in your project - Code your answers to each of the 5 questions using the Standard JavaScript Template described below:
NOTE: Start with a separate JavaScript file with a function called main(). This should be the first function called and point of entry for execution. All other code to accomplish whatever challenge should be in it's own function called from the main() function. No JavaScript code should execute outside of a function. This pattern should be considered our 'Standard JavaScript Template' for all exercises.
main() {
// call exercise1()
// call excercise2()
// etc.
}
Before you type ANY CODE, write out your steps to solve each exercise in each file. Use single line comments to pseudocode what you need to do to solve the problem then fill in the blanks.
// JUST AN EXAMPLE!
// Create an array
// Load objects into the array
// Iterate through each element in the array and print the element
Create two variables called five assigned 5 and eight assigned 8. Next create an if statement compairing five is less than eight. If it's true, , print “5 is less than 8”. Else, print ERROR in the console or browser..
Print all even numbers from a user's given start and stop number in the console or browser.
Ask the user to create two variables. Create a function that takes two variables and returns the largest of the two numbers in the console or browser.
Create a program that takes user input. If they enter 1, call a function that prints 1. If they press 2, call a function that prints 2. If they press 3, call a function that prints 3. If they enter q, quit. Else, print ERROR in the console or browser.
Ask the user to enter a starting balance for their bank account. Ask the user if they want to make a withdraw or deposit. Ask them for the amount to withdraw or deposit, then show the the new balance in the console or browser. Let the user quit when they enter q.