Exploring Computer Science Lesson 4-8

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech June 2011.
Scratch Understanding some programming techniques using Scratch Resetting, Parallelism and Events.
CATCH SCRATCH! Programming from Scratch. Remember Scratch?
Section 3 Calculations National 4/5 Scratch Course.
Timers Exploring Computer Science Lesson Objectives The students will be able to: Create a timer.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
My Scratch Story Exploring Computer Science Lesson 4-7.
Exploring Computer Science 2/9/15 2/9Moving Scratch 2/10Moving Scratch worksheet 2/11 Scratch Baseball Game 2/12Scratch Alphabet Learning Game 2/13Game.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
WHAT IS A COMPUTER? LESSON 1-1. OBJECTIVES The student will be able to: Explain and give examples of the concepts on computers and computing.
Scratch Dialogues Exploring Computer Science – Lesson 4-3.
WHAT IS A COMPUTER? LESSON 1-1. OBJECTIVES The student will be able to: Explain and give examples of the concepts on computers and computing.
Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4.
Adding Sounds Games Programming in Scratch. Games Programming in Scratch L6 Adding Sounds Learning Objectives Learn how to add sound to a Scratch game.
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Making a Flappy Birds Game PART 2 – MAKING THE BIRD FLAP AND FALL – AND DEVELOPING THE GAME FURTHER (ADDING ADDITIONAL CHARACTERS, GOODIES, ENEMIES AND.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech.
Introduction to Programming with Scratch Exploring Computer Science – Lesson 4-1.
Randomness Exploring Computer Science Lesson 4-10 – Part 2.
Event Driven Programs Exploring Computer Science – Lesson 4-5.
Customise & Explain your game
Coding Workshop Patty Hicks Still Middle School
Madlib-Input, Strings, and Lists in Scratch
How to work with your sprite
Exploring Computer Science Lesson 4-7
Spanish Mad libs with Scratch
Exploring Computer Science – Lesson 4-5
Exploring Computer Science Lesson 4-13
Combining Like Terms Friday, October 26th, 2012.
Exploring Computer Science Lesson 4-14
Exploring Computer Science Lesson 4-10 – Part 1
Building an App: Color Sleuth
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Exploring Computer Science Lesson 4-14
Getting Started with Scratch
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
And and or…and RANDOMNESS
Year 2 Autumn Term Week 9 Lesson 1
Moving Sprites in Scratch
Exploring Computer Science Lesson 4-13
Basic Lessons 7&8 Mr. Husch.
Exploring Computer Science – Lesson 4-3
Conditionals Exploring Computer Science Lesson 4-9.
Motion in Scratch 1.
Journal Entry #4 Title: Lesson Learned
Exploring Computer Science Lesson 4-7
Year 2 Spring Term Week 8 Lesson 4
Exploring Computer Science Lesson 4-8
Code to Enhance Learning
Game Over Module 4 Lesson 2.
Exploring Computer Science Lesson 4-12
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Getting Started with Scratch
Year 2 Spring Term Week 8 Lesson 4
Exploring Computer Science Lesson 4-10 – Part 2
Exploring Computer Science Lesson 4-14
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Exploring Computer Science Lesson 4-13
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Asking Questions in BYOB Scratch.
Just Basic Lessons 7 Mr. Kalmes.
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Exploring Computer Science Lesson 4-12
Year 2 Autumn Term Week 9 Lesson 1
How to use Open study By blm1.
Exploring Computer Science Lesson 4-10 – Part 1
Presentation transcript:

Exploring Computer Science Lesson 4-8 Variables Exploring Computer Science Lesson 4-8 Please have your Journals out! Have Scratch open to a new program

Objectives The students will be able to: Explain the concept of variables. Create examples of variables. Explain the concept of iteration. Create examples of iteration.

Write down the question. Journal Entry What does the word variable mean in both mathematical and English terms? Write down the question. Answer with complete thoughts and sentences or you will not receive full credit on your journal

Variables Look at this example: x + 3 = 5 Look at this example: 2x= 12 What is the variable? What is the value of x? Look at this example: 2x= 12 Why isn’t “x” the same in both cases?

Variables in Programming A variable is a name that represents a value that can be changed.

Open Scratch! We are going to build the beginning of your Scratch program together. The program will reward you with points when you choose a good food and take points away when you choose a bad food.

Add Text and Sprites Add a color to the stage. Add “Click on a food to eat it” to the stage. Add sprites for bananas and cheesy-puffs

Our Variable We are going to need a variable to track our points toward good nutrition. Some place where we can keep track of the “score” We can name a variable anything we want but a good coding technique would be to make the name meaningful. What would be a good name for our variable?

Adding a Variable Click on “Data” Click on “Make a Variable” Name the variable and set it for all sprites I will call mine “Good Nutrition Points”

Adding Nutrition Points I want to add a point when the banana is clicked. With the Banana sprite selected add this block: Adding 1 to a variable is called iteration.

Subtracting Nutrition Points I want to subtract a point when the Cheesy-puffs sprite clicked. With the Cheesy-puffs sprite selected add this block:

Initializing the Variable We want the Nutrition Points to be set to zero when the game starts. Add this block to any sprite:

Customize Your Program! Add a food that is worth 2 points when clicked Add a food that is -3 points when clicked Show me your program when you’re done If you are done early make the program look better or add more foods.