Page 16

Instructional Days: 16-17

Topic Description: This lesson introduces And, Or and randomness. Students have an opportunity to practice utilizing these features in the context of programs.

Objectives:

The students will be able to:

Use conditionals with And and Or to write a grade program.  Use a random number generator to write a dice program.

Outline of the Lesson:

Journal Entry (5 minutes)

And/Or discussion (15 minutes)

Grades program (35 minutes)

Random lecture (20 minutes)

Dice (35 minutes)

Student Activities:

Complete journal entry.

Participate in And/Or discussion.

Develop Grades program.

Participate in discussion of Random.

Complete Dice program.

Students will do the following:

Write a Grades Program: https://scratch.mit.edu/projects/91982736/

Write a Dice Program: https://scratch.mit.edu/projects/50735052/

Journal Entry: What’s the difference between And and Or? What does the word random mean in English? o Students should complete individually and then share with their elbow partners.

And/Or Discussion o Start with a few journal entries about And and Or.

o Kinesthetic And/Or Activity (Following is a possible set of conditions.) § Tell the students to stand up if the condition is true.

§ Say: If (you are a girl AND you are wearing blue) stand up.

Find a girl that is not wearing blue and is sitting. Ask her why she is sitting if she’s a girl? ( Answer: she’s not wearing blue)

Ask: How many parts of the condition must be true for you to stand up if it is an AND? (Answer: both)

§ Say: If (you are a boy OR you are wearing blue) stand up.

Find a boy that is standing but is not wearing blue. Ask: Why are you standing if you are NOT wearing blue? (Answer: I’m a boy)

Ask: How many parts of the condition must be true for you to stand up if it is an OR? ( Answer: at least one)

Ask: If both parts of the condition are true for an OR, is it ok to stand? (Answer: YES!)

o Show the students the “and” and “or” blocks in Scratch.

§ Emphasize how they are hexagon shaped and take two other hexagons. o Show the students Grades Project.

Grades o Circulate and help students with projects. o If many students are stuck, build the “B” part of the code together as a class.

o In the last minute, have students share their solutions with their elbow partners.

Random lecture

o Have a few students share their journal entries about what random means.

o Ask: if I roll a pair of dice, will the numbers come out in order (2, then 3, then 4 the next roll, etc.) (

Answer: Most likely not) o Roll a pair of dice a few times to prove it. o This unpredictability is called randomness.

o Randomness can make games more exciting.

§ For example, how many spaces will I get to move this turn? o Randomness is also used in computer science for simulations and in scientific/statistical experiments. o Walk students through dice.sb showing them the “pick random _ to _” block.

§ Explain that the numbers create the range that the random integer can fall under. The block works inclusively. Therefore 1 to 6 will produce numbers 1,2,3,4,5,6.

Dice o Instruct students to finish dice.sb so that it creates a pair of dice. They can create their own look for the dice.

o Circulate and help students with projects. o In the last minute, have students share their solutions with their elbow partners.

Resources:

Grades Project

grades solution.sb

dice.sb

dice solution.sb

Grades Project

Your task is to make a Scratch program that will tell you the letter grade based on the percentage.

1. Create a variable grade.

2. Double click grade to display the scroll bar.

3. When the green flag is clicked, the program should look at the value of grade and the sprite should respond with a letter as follows:

A: greater than 90

B: greater than 79 and less than 90

C: greater than 69 and less than 80

D: greater than 59 and less than 70

F: less than 60

At Crazy High School, students only qualify for tutoring if they have a B OR a D. After it says the grade, make your program say “You qualify for tutoring” if the grade is a B or D.