Fall 2024 - P5
Big Idea 3 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .10 |
3.3 Mathematical Operations
Learn the different types of Mathematical Operations
Important Terms :)
- Algorithm: A list of steps that occur in a specific order
- Sequencing: Things are done in order
- Flow chart: A way to write an algorithm; use arrows to tell the descision
- Psuedo code: Fake code. It’s verbal instructions and comments on what each section is doing
## Continued Mathematical Operators
This is kind of like your vocab list:
- Addition: a + b
- Subtraction: a - b
- Multiplication: a * b
- Division: a / b
- Exponents: a ** b
- Modulus(remainder of a / b): a MOD b
- MOD is %
- Floor division(rounds to the nearest whole number):
- In python a // b
- Javascript doesn’t have an operator so use Math.floor(a / b)
- Math is in order of operations
Some Examples:
first = 2
second = 4
print(first + second) # Output is 6
print(first - second) # Output is -2
print(second / first) # Output is 2.0 (division returns a float)
print(first ** second) # Output is 16 (2 raised to the power of 4)