Objective
By the end of this lesson, you will be able to understand and apply basic arithmetic concepts in coding.
Materials and Prep
- Pen or pencil
- Blank paper
- Calculator (optional)
- No prior knowledge required
Activities
-
Activity 1: Introduction to Arithmetic in Coding
Start by explaining that arithmetic is an important part of coding. It helps us perform calculations and manipulate numbers in our programs. Ask the student to think of a simple calculation they would like to perform, such as adding two numbers.
Once they have chosen a calculation, guide them through writing a simple code snippet to perform the calculation. For example, if they want to add 5 and 3, they can write:
result = 5 + 3;Explain that the result variable will store the sum of 5 and 3, which is 8. Encourage the student to experiment with different calculations and see the results.
-
Activity 2: Arithmetic Operators
Introduce the basic arithmetic operators used in coding: addition (+), subtraction (-), multiplication (*), and division (/). Explain what each operator does and how it can be used to perform calculations.
Ask the student to come up with their own arithmetic expressions using these operators. For example, they can try:
result = 10 - 4;Encourage them to explore different combinations of numbers and operators to see the results.
-
Activity 3: Order of Operations
Explain the concept of order of operations in arithmetic. Teach the student the acronym PEMDAS (Parentheses, Exponents, Multiplication and Division from left to right, Addition and Subtraction from left to right).
Provide them with some arithmetic expressions and ask them to solve them using the correct order of operations. For example, they can try:
result = 4 + 3 * 2;Guide them through the steps of solving the expression correctly to get the result of 10.
Third Grade Talking Points
- "Coding is like giving instructions to the computer to perform tasks."
- "Arithmetic is important in coding because it helps us perform calculations and manipulate numbers in our programs."
- "We can use arithmetic operators like addition, subtraction, multiplication, and division in coding."
- "The order of operations tells us the sequence in which different arithmetic operations should be performed."
- "We can use parentheses to change the order of operations and prioritize certain calculations."