Skip to content

jonnebonde/lesson-task-pf-module1-lesson2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Programming Foundations - Module 1

Lesson Task 2 Questions

Add all the answers to the script.js file.

Giving your variables meaningful names is very important. The names should indicate what type of information or data the variable holds.

Question 1

Create two number variables, one with an integer value and one with a decimal value.

Question 2

Declare and initialise a variable with all the working days of the week separated by hyphens -.

Question 3

Create four variables that demonstrate the following operations:

  • addition
  • subtraction
  • multiplication
  • division

Question 4

Declare a boolean variable with an initial value of false.

Question 5

Console log the number of characters in this string: "The frogs are angry."

Question 6

Convet the following variable names to camelCase:

var time_elapsed;
var totalprice;

Question 7

Convert the following string values to number values:

var number1 = "53";
var number2 = "44.6";

Question 8

Check the type of the following variables and log the results:

var pet = "donkey";
var age = 89;
var discountApplied = true;
var timeLeft;

Question 9

Declare and initialise a variable with the value "Updating heading".

Select the h1 element on the page and set it's inner HTML value to be the variable created above.

Question 10

Select the body element on the page and change its background colour to lightskyblue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.9%
  • HTML 24.1%