Testing for Prime Numbers with Predicate Blocks in BYOB/Scratch: A Scaffolding Tool for Teaching Boolean Expressions in AP Computer Science



This lesson is primarily directed at the Advanced Placement Computer Science class which is taught using Java. BYOB/Scratch serves as an excellent scaffolding tool to visually represent programming concepts. Non AP classes which use programming concepts such as loops and boolean (true/false) expressions may also make use of this lesson. Students should already be familiar with concepts such as variables and loops. BYOB allows for the creation of several types of custom built code blocks. A predicate block is used to create boolean expressions.

Lesson Time

2 Class Periods

Industries / Subjects / Grades

Industries / Pathways
  • Information and Communication Technologies Information and Communication Technologies
Grade Levels
  • 10
  • 11
  • 12
  • Post-Secondary
  • Adult

Standards and Objectives


California's 2008 CTE Standards (2)
California Academic Content Standards (1)

Related Instructional Objectives (SWBAT...)

  • Creating custom operator blocks in BYOB/Scratch
  • Learning how to use the modulo operator to test for even divisibility
  • Learning how to define prime numbers
  • Learning how to create a prime number block in BYOB/Scratch
  • Using the lesson as a scaffolding tool for AP Computer Science

Get access to the rest of this Lesson and over 3000 more!

Create a Free Account or now!