Section 3 Video 3 Notes and Planning

Arithmetic Operations in Programming

Link to Video

Arithmetic operations exist in most programming languages.

Include: Subtraction, Addition, Multiplication, Division, Getting the Remainder

  • All operations are represented by symbols.

  • Subtraction: “-“

  • Ex: a - b

  • Addition: “+”

  • Ex: a + b

  • Multiplication: “*“

  • Ex: a * b

  • Division: /

  • Ex: a / b

  • Getting the Remainder: MOD

  • Ex: a MOD b

In all of these scenarios, a/b can be an expression or just a simple number.

Just like how numbers can be assigned to variables, a set of operations involving different values and numbers can also be assigned to a variable

Ex:

num1 ← 20

num2 ← num1 + 98

num3 ← num2 * num1 + 8 / num2

Arithmetic operations in programming are performed in the same order as operations in mathematics. For example, operations in parentheses should be done first.

Idea for Hacks

A series of challenges and problems in the form of a quiz including arithmetic operations and expressions.

Possible Options: Students will clone a fastpages repository in order to complete the given assignments and interact with different elements.

Link to planning issue