Unit 1 Lesson 4 Expressions and Assignment Statements Lesson Plan
Unit 1 Lesson 4 Expressions and Assignment Statements Lesson Plan
Overview
This lesson introduces expressions and assignment statements that include
mathematical operators and variables and corresponds to the College Board AP
CSA topic 1.3. By completing this lesson, students learn about arithmetic
operators and how they are used, stored, operator precedence, and the outcome
of using each operator. Students are given an opportunity to use arithmetic
operators in the Java programming language.
Note: If you wish to provide a URL/link for students to access this lesson, you
will need to replace “yourCustomCourseName” in the customized link below
with the name of your custom course that you created. For instructions on how to
set up a custom course, please see https://www.csawesome.org/runestone-e-book.
CON-1 The way variables and operators are sequenced and combined in an expression
determines the computed result.
1
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
2
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
left.
➢ CON-1.B.2 During execution,
expressions are evaluated to produce a
single value.
➢ CON-1.B.3 The value of an expression
has a type based on the evaluation of
the expression.
3
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
Learning Activities
Day 1:
Have the students simplify the expression by hand and then enter their
expressions into a compiler and find an answer. Discuss how the answers
are different and why.
4
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
Day 2:
● Hook/Motivation (5 mins):
○ Have students do a division problem like 15 / 4. Ask them what the
remainder is (3). Introduce the operator % (mod or modulo or remainder)
where 15 % 4 returns the remainder of 15 / 4. Go through the division
problems in Figure 1.
● Experiences and Explorations (35 mins):
○ Direct Instruction: Clarify what the mod operator is and what it does.
And give some examples of how it works, mathematically and using the
compiler. Have students guess what Active Code 4 will do in 1.4.4 before
running it and have them do the Check Your Understanding exercises in
pairs. You may choose to show one or both of these videos modulo
operator with apples and nets analogy and/or the modulo operator with
the clock analogy video. Distinguish between double division, integer
division and modulo.
○ POGIL / Collaborative Group work: POGIL - "%" Operator
○ Pair Programming: Have students do the Dog Years Programming
Challenge in pairs.
5
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
6
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
Differentiation: Enrichment
● CodeStepByStep.com provides practice problems on various topics
covered.
● Practice It provides practice problems on various topics covered.
● Clock Arithmetic and Modular Systems1
● Pseudo Random Number Generator2
Background Knowledge
1 "Clock Arithmetic and Modular Systems." Chapter 5 Number Theory. 2004. Pearson Education. 2019
<http://socrates.bmcc.cuny.edu/jsamuels/text/mhh-discrete-05.4.pdf>.
7
Lesson Plan
Lesson 1.4: Expression and Assignment
Statements
Teaching Tips
● CSP → CS A Tips
After reviewing this lesson plan in the professional development, complete the form
found here to provide feedback on the lesson, materials provided, etc.
Attributions
1. “Clock Arithmetic and Modular Systems.” Chapter 5 Number Theory, Pearson
Education, 2004, socrates.bmcc.cuny.edu/jsamuels/text/mhh-discrete-05.4.pdf.
Accessed 2019.
2. “Mobile CS Principles.” Mobile CSP, 2019, course.mobilecsp.org/mobilecsp/unit?
unit=23&lesson=65.