+ All Categories
Home > Education > Programming with Scratch

Programming with Scratch

Date post: 25-Jul-2015
Category:
Upload: cort1026
View: 61 times
Download: 0 times
Share this document with a friend
18
http://cs.harvard.edu/mal an/scratch/index.php Communicating via Programming Languages FA2014 Mrs. Hauer Palmyra Area High School 1
Transcript

1

http://cs.harvard.edu/malan/scratch/index.php

Communicating via Programming Languages

FA2014Mrs. HauerPalmyra Area High School

3

Objectives

At the end of this lesson, students will be able to:

• Understand Why We Use Programming Languages

• Identify Basic Scratch Programming Elements

• Use Scratch to create a Holiday Greeting Card

Note-taking Sheet

4

Programming

• The ability to talk to a computer in a language it can understand

• The computer will read your programming code and execute your instructions

• The code must be correct and unambiguous

5

6

Python- Example

7

Programming Languages

Why do we have programming languages? A way of thinking

A way of effectively expressing instructions

What is a language for?Tell the hardware what you want it to do

Not necessary to make physical hardware changes

8

Programming Vocab

• Statements

• Boolean Expression

• Conditions

• Loops

• Variables

• Threads

• Events

• Sprite

9

Scratch Cat – Sprite

2D image or animation

Costume 1 Costume 2 Costume 3 Costume 4

Animated Sprite

10

Statements

• Tell the computer what to do

• It is an instruction to follow

SCRATCH EXAMPLE:

11

Boolean Expression

• An expression that is either TRUE or FALSE

SCRATCH EXAMPLE:

With Boolean expressions we can create conditions!

PYTHONBoolean = bool(input( “Enter a Boolean Value: “))

12

Conditions

• Must be TRUE to occur

• If, When & Until are condition labels

SCRATCH EXAMPLE:

If Construct

13

Conditions Cont.

If- Else Construct

PYTHON

Value = input (“Press a Key”)

If value == SPACE: Print “Hello!”Else: Print “Goodbye!”

14

Loops

• A loop executes multiple statements

SCRATCH EXAMPLE:

15

Variables

• A changeable value recorded in memory

• Used whenever a value must be stored

SCRATCH EXAMPLE:

16

Threads• A mini-program within a program

• You can have multiple threads in your program

SCRATCH EXAMPLE:

It is helpful to use separate threads for conceptually distinct tasks

17

Events• Threads and sprites can communicate through

the use of EVENTS

SCRATCH EXAMPLE:

18

Essential Questions

Why do we use Programming Languages?

What are some of the basic Scratch programming elements?


Recommended