Exercise Weekend

Goal: In the Arithmetic video, we learned:

  • How to access the JavaScript Console
  • Addition, subtraction, multiplication, and division using JavaScript
  • How to use the % operator
  • NaN means not a number but is actually considered a type of number

Begin getting comfortable with these concepts by completing the practice exercises listed below. Soon enough, they'll be second nature!

Warm Up


Make sure you understand the following before moving on:

  • What is the % operator? How is the action it performs different than simply dividing?
  • How can we access the JavaScript console?
  • When might we see NaN?

Code


Complete the following exercises to practice arithmetic in JavaScript:

Add:

  • 77 to 99
  • 34 to 1233
  • -53 to 99
  • 9,092 to -12312
  • 943,456,575 to 39,087,092,348,570

Subtract:

  • 99 from 665
  • 555 from 23
  • 7,912 from 88888
  • 6,348,709,234 from 87,023,984,709,871,234.

Multiply:

  • 89 and 54
  • 932 and 1,900
  • -34 and 8
  • 25 and 700

Divide:

  • 1008 by 7
  • 23423 by 75
  • 90 by 3
  • 9,870,834,205,987 by 324
  • A number by 0.
  • 0 by 0.

Find the remainder of dividing the following numbers:

  • 1008 by 7
  • 23423 by 75
  • 90 by 3
  • 9,870,834,205,987 by 324