Basics-01

  • Get to your submission folder under exercises/javascript-basics-01

  • Each step has a prepared html file to work with, use it

  • You should create a javascript file for each step with the name of the step.

    e.g : Step_1.html + Step_1.js

  • COMMIT AFTER EACH STEP, call each commit by the name of the step

References

Goals:

  • Learn general basic programming syntax as applied to Javascript

  • Competencies:

    • variables

    • strings

    • simple maths

    • if, else

Step 1 : Variables

  1. Define a variable, "name"

  2. Show this variable in an alert box

  3. Commit

Step 2 : Variables 2

  1. Define three variables: name, surname and city.

  2. Commit!

Step 3 : Strings concatenation

  1. Show a dialog box asking the user for his name

  2. Show an alert box saying "Hello, ", then the name provided

  3. Commit!

Step 4 : Strings concatenation 2

  1. Just like Step 3, but ask for name, surname, and city (Step 2 + Step 3)

  2. Commit

Step 5 : Simple Math

  1. Ask for the user for two numbers

  2. Multiply them

  3. Show the result to the user

  4. Commit

Step 6 : External files and Simple Math

  1. Create a separate javascript file

  2. Include it in the html

  3. Have the user provide two numbers

  4. Divide them

  5. Show the user the remainder of the division

  6. Commit

Step 7 : Multiple operations

  1. In an external file:

  2. Ask the user for his shoe size and his birth year

  3. Create a function that:

    1. Multiplies the shoe size by 2

    2. Adds 5

    3. Multiplies by 50

    4. Subtracts the birth year

    5. Adds 1766

  4. Shows the result to the user

  5. Commit

Step 8 : if, else

  1. Ask the user for their age

  2. If the user is over 18, show "you are over 18", else, show them "you are under 18"

  3. Commit

Congrats!

You finished Javascript Basics 1! Send a pull request.

Last updated