Skip to content

Session #7 Back to the basics

Seth McLaughlin edited this page Jun 6, 2014 · 4 revisions

Links

In class assignments

Assignment #1

Write a JavaScript expression which adds 5 to 10. This expression should evaluate to 15.

Assignment #2

Define three variables. One should hold your age, one should hold your favorite number, and one should hold the number of siblings you have.

Next, define a new variable which stores the result of adding the previous three variables together.

Assignment #3

Define a variable to hold the number of hours in a day.

Multiply this value by 7 to get the number of hours in a week. Assign this to a new variable.

Next, multiply this by the number of weeks in a year (52) and assign the result of this in a new variable.

Finally, divide this number by the number of days in a year (365). What is the result?