### Present Remotely

Send the link below via email or IM

• Invited audience members will follow you as you navigate and present
• People invited to a presentation do not need a Prezi account
• This link expires 10 minutes after you close the presentation

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

# Compsci 4.11 - Review Variables and Boolean Logic

Unit 4 - Algorithms & Data
by

## Jason Eiben

on 1 December 2014

Report abuse

#### Transcript of Compsci 4.11 - Review Variables and Boolean Logic

AIM: SWBAT
I. Do Now
II. Notes - Data Types & Lists
III. Unit 4 Week 1 Project Setup
IV. Flowchart & Pseudocode
Aim & Challenge
Agenda
Lesson 4.11
Do Now:
II. Lesson
III. This Week's Challenge
IV. Share-Out
Partner Review
Pick a neighbor, and swap to see their Draw a Square program. Take 3 minutes to discuss:
Shout-Outs, Questions & Prep for Next Class
Color code...
Black - copy this
Blue - paraphrase
Red - no need to copy
This Week's Challenge:
1) Similarities and differences
2) Difficulties and questions
3) How could you make your project more interesting?
Custom blocks so far
V. Hangman Review
VI. Turn in Weekly Challenge
2) Open the shared "challenge reflection" document
4) Copy & paste the URL of your saved project

VII. Gallery Walk
1) Make sure your project is open and visible on the screen. Make it start when the green flag is pressed!

2) You will have 15 minutes to browse the room to see other student projects

3) At the end of this time, you will get to vote for your 3 favorite

Unit 4 Week 2: Hangman
How we can improve
So, how do you make a brick wall that is X rows high?
if X is even...
do this X/2 times
if X is odd...
do this (X-1)/2 times +
How can you tell if a value is odd?
=1
=4
=0
=2
=0
the mod, or "modulo" operator reports the remainder that results from dividing the first number by the second number.
15 mod 4 =
12 mod 3 =
9 mod 2 =
8 mod 2 =
4 mod 2 =
[any even number ] mod 2 = 0
3
0
1
0
0
if X mod 2 = 0,
then X is even!

if X mod 2 ≠ 0,
then X is odd!
10/4 = 2R2
10 mod 4 = 2
15/4 = 3R3
9/2 = 4R1
12/3 = 4R0
8/2 = 4R0
4/2 = 4R0
14 mod 2 = 0 because 14/2=7R0
15 mod 2 = 1 because 15/2=7R1
(if X mod 2 = 0)
(if X mod 2 ≠ 0)
1) By being "better" students
Remember:
1) You need to know what you are trying to do before you can try to do it!
2) If you are not willing to do the thinking, you will not get extra help.
3) You CAN solve these problems if you take your time and understand what you are telling the program to do.
Start
Tell user the rules
Count key presses
Build a wall with # of bricks
Compare number to high score
Display current high score, play again?
Save new high score, play again?
higher
lower
Q1 ends on Friday! All grades will be finalized at the end of the day.
Start
Process
Data input
Decision
Flowchart Symbols
1) Watch Sample Game
2) Create Flowchart
3) Pseudocode
4) Lab
Data Types & Lists
Snap Blocks:
What does each do?
Data Types:
Lists
Integers
Floats
Strings
Booleans
A whole number, not a fraction
the green block is a reporter, the value it is reporting is an integer
"Floating point" values contain decimal place values. Often have a set precision
Have two possible values: "True" or "False"
A sequence of characters, including letters, numbers, and symols
an abstract data type that implements a finite ordered collection of values
Lists can contain any data type, including other lists!
Data Structures
a particular way of organizing data so that it can be used efficiently. Different kinds of data structures are suited to different kinds of applications
Lists are one example of a data structure
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Sunny
Sunny
Cloudy
Raining
Cloudy
Raining
Snowing
45
50
47
40
42
36
30
starts a set of blocks
reports true/false
contains blocks to use or repeat
sequential commands
reports a value
ends a set of blocks
Challenge Prep
Use this space to find the class averages for Algebra 2 and Chemistry. Then, determine the GPA based on those two scores.
In this space, describe the process you are using to determine the averages and the GPA
"Report Average"
average all HW scores
average all CW scores
average all Quiz scores
average all Test scores
Multiple averages by category weights
Add category scores for total class average
Demo - List Blocks & Starter Kit
1) How great you can be
2) How to be greater

Units 1-4 Comprehension Check
Key areas for review: Script & Global Variables, Modulo, Data Types, Lists
- Be willing to take notes
- Listen and focus during lectures
- Be prepared for heavy thinking
2) By supporting each other
- Work with partners who can help you (not just a teacher)
- Accept failure and dive back in
Remember why we are here!
To explore, learn, have fun, try new things, and be creative
This class is not meant to be stressful, but it IS stressful when students feel like they are not successful...
this means: some more traditional class features
this means: new partners & expectations
Unit 4 Week 2:
Hangman
Most common feedback:
"having trouble starting projects"
"more examples of blocks of code"
Walk through to review & build
Pick word
letter guess
does word contain guess?
add letter to incorrect guess list
put correct letter on blank spaces
yes
no
Reset stage & make blank spaces
Is the player out of guesses?
Did they guess the full word?
or
yes
no
New Starter Kit Includes:
- Costumes for sprite (all letters) and stage (hangman background w/ body parts)

- Some pre-built blocks

- Comments that start to explain each major section
Variables:
Boolean Values:
We will want to keep track of...
We will put these into...
Game Over
Follow Along as we build the variables and logical flow of the program!
Using your notes and the new starter kit, start building your new version of Hangman!
Full transcript