Math Operators with Variables
Go to Activity: Math Operators with Variables.
Complete student tasks 1-5.
Tasks
Task 1
Code: Test at least three different equations.
Shared project: Note: Simply enter the code you created to try different equations. It is okay that it does not show how many equations you tried.
Code:
Shared project:
Task 1 Challenge
Code: Make longer addition equations so that the code calculates the sum of 5 or more numbers.
Shared project:
Tasks 2
Code: Add a thirdNumber variable. Create an equation using both the addition operator (+) and the multiplication operator (*).
Shared project:
Tasks 3
Code: Add a fourthNumber variable. Create an equation using 3 different operators.
Shared project:
Task 3 Challenge
Code: Create an equation using all 4 basic operators and at least 5 unique variables.
Shared project:
Tasks 4
Code: Create 2 variables
Initialized temp C with common Celsius temp. Create an equation using a formula. Show the temp in a splash screen.
Shared project:
Task 4 Challenge
Code: Create an equation for converting back to Celsius. Note: Be sure to read the directions carefully. It suggests that you move to JavaScript to make sure the calculation works properly.
Shared project:
Task 5
Code: Debugging
Shared project:
Reflection/Homework
- In JavaScript, what is the resulting value of answer for answer = 5+3*2? Explain why the answer is not 30.
- How is putting operators and numbers into a calculator different than writing in code (example: 2+3+4*4)? Explain.
- Research and describe 2 other Math Operators found in the math menu in MakeCode (hover over values for more information).
- What did you learn about variables, data types, strings, and join?