Tags

Activity Industry Sector
Information Technology

Activity Originally Created By: George Benainous

Independent Practice

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

Activity Overview / Details

 

Review the concepts necessary to define an isPrime block. 

As a prelude to creating the the isPrime block, students should create an isEvenlyDivisibleBy block which will be incorporated into the isPrime block.

Here is a picture of the isEvenlyDivisible block.

If necessary, provide the pseudocode for the isPrime block: Set a variable called prime to truel Set a count variable to 2. Repeat until the count is equal to the number if the number is evenly divisible by the count set prime to false add 1 to the count Students should be given a set amount of time to develop the Prime Number animation in BYOB/Scratch depending on the ability level of the class.