Level 1 JavaScript skills
Part 1 covers the foundation skills you need to get started with JavaScript. This learning involves working your way through the skills below. Once you have completed all the skills, get the teacher to check your work and you can start part one of the project to show that you are ready to carry on with learning more complex Javascript skills.
For Part 1 JavaScript skills you must use GitHub Codespaces
You will work through the exercises in this repository
Use the link your teacher will give you to the GitHub Classroom assignment
Learning goal - We are learning how to:
Use code comments and a template to organise your code.
By the end of this topic you will have:
Gone through the google slide.
Modified script.js using the template in the slideshow. It is expected that you use that template to structure your code for all activities.
Learning goal - We are learning to how to:
Set up, name and use variables to store information. This will allow us to store the information we have gained from the user.
By the end of this topic you will have:
Gone through the slides and watched all the videos.
Copied the code from task 1
Update the header comments and console.log()
Defined three variables to hold:
The users' name.
The users' age.
How much pocket money the user has.
The current year.
Used console.log() to display the message below:
Hi _______
As of ____ you are __ years old
You have __ dollars
Learning goal - We are learning how to:
Do basic math using JavaScript.
By the end of this topic you will have:
Gone through the slides.
Copied the code from the last task
Update the header comments and console.log()
Displayed this message, using JavaScript maths to work out the correct values (marked in red)
Hi _______
As of ____ you are __ years old
You were born in ____
In 10 years you will be __ years old
You have __ dollars
Half of your money is __
Learning goal - We are learning how to:
Use console.log() to help us find bugs in our code.
Identify different types of bug.
Strategies for bug hunting.
By the end of this topic you will have:
Gone through the google slides.
Got the program working properly.
Learning goal - We are learning how to:
Use alerts to display messages.
Use prompts to ask users for information
Understand the difference between adding strings vs numbers
Convert strings to numbers
By the end of this topic you will have:
Gone through the google slides.
Copied your code from task 3 - Maths.
Update the header comments and console.log()
Added alerts and three prompts to display information and ask the user for input:
Welcome the user to the program.
Ask the user their name.
Ask the user their age.
Ask the user how much pocket money they have.
Then display the message from task 3 in an alert.
Debug it. Make sure it works correctly with different inputs.
Learning goal - We are learning how to:
Use arrays to store several pieces of information.
By the end of this topic you will have:
Gone through the slides and watch the video.
Copied the code from the last task.
Update the header comments and console.log()
Created an array with four different messages. eg:
"You loath chocolate"
"Chocolate is meh"
"Chocolate is pretty good"
"Chocolate is the best thing EVER!!!!"
Ask the user for a number between 0 and 3. eg:
"On a scale of 0-3 how much do you like chocolate"
Display that message from the array in an alert
Learning goal - We are learning how to:
Use conditional statements to make decisions.
By the end of this topic you will have:
Gone through the slides and watch the video.
Copied the code from the last task.
Update the header comments and console.log()
Altered your program to use the user's pocket money to check whether they have enough money to buy a 4 dollar chocolate bar.
Display one message that states either:
"Hi _______
I predict you were born in ____
Your pocket money is _ dollars.
Sorry you CAN'T afford a chocolate bar"
"Hi _______
I predict you were born in ____
Your pocket money is _ dollars.
You CAN afford a chocolate bar"
Learning goal - We are learning how to:
Get a section of code to repeat a certain number of times.
By the end of this topic you will have:
Gone through the slides and watch the videos.
Copied the template from task 1.
Update the header comments and console.log()
Created a program that asks the user for a number five times, and adds all the numbers together.
Hint:
FOR as long as the count is in the range 0 to 5 repeat:
input a number.
store the number.
add the number to the total.
once repeated 5 times say what the total of the numbers is.
Learning goal - We are learning how to:
Define and call functions.
By the end of this topic you will have:
Gone through the slides.
Copied your code from the last task.
Update the header comments and console.log()
Converted the program to use functions:
Welcome the user and ask their name by calling the askUserName function.
Ask the user their age by calling the askUserAge function.
Ask the user how much pocket money they and decide if they can have a chocolate bar by calling the askUserMoney function.
Learning goal - We are learning how to:
Get a html button to work.
By the end of this topic you will have:
Gone through the slides.
Copied your code from the last task.
Update the header comments and console.log()
Created a start() function.
Moved the calls to your functions inside the start() function.
Edited the HTML - Add a button that activates the start() function.
1) Go through the slides
2) There is no activity for this section
Learning goal - We are learning how to:
Develop a testing plan which covers expected input.
By the end of this topic you will have:
Gone through the slides.
Used your program from task 10 - activate via button
Tested the program using expected values. The teacher will share this testing plan with you through Google Classroom. There should be at least 4 test cases.
In Part 2 you will look at testing Boundary and Invalid cases.