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
Hacks
- Create an algorithm that adds 2 set variables together, then it divides that number by 4, then prints that number
Python version
- The python code down below follows a specific order. First the computer will register num1 as 5 and num2 as 11. Then it will print num1 and then num2.
num1 = 5 num2 = 11 print(num1) print([num1 + num2] / 4)
Javascript version
- The Javascript code below does the exact same thing as the python example above.
let num1 = 5; let num2 = 11; console.log(num1) console.log([num1 + num2] / 4)
Hacks
- Create an algorithm that multiplies two values together and then takes the mod of those two values when divided. Python Version: ```python numb1 = 12 numb2 = 8
product = numb1 * numb2 print(“Product:”, product) modulus = product % numb2 print(“Modulus:”, modulus)
Javascript Version:
```javascript
let numb1 = 12
let numb2 = 8
let product = numb1 * numb2
console.log("Product:", product)
modulus = product % numb2
console.log("Modulus:", modulus)
Hacks
- Make a algorithm that adds whatever 2 numbers the user inputs, have fun Python version:
x=4
y=5
print(x+y)
Javascript Version
var x=4;
var y=5;
console.log(x + y)
Homework | Weightage | Grade | Comments | ||
---|---|---|---|---|---|
Hack 1 | 22.5 | TBD | TBD | ||
Hack 2 | 22.5 | TBD | TBD | ||
Hack 3 | 22.5 | TBD | TBD | ||
Hack 4 | 22.5 | TBD | TBD | ||
Total | 0.9 | 90 |