Post on 25-Jul-2015
1
http://cs.harvard.edu/malan/scratch/index.php
Communicating via Programming Languages
FA2014Mrs. HauerPalmyra Area High School
2
6th Grade Programmer and Game Developer
What do you think about kids programming?
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
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
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!”
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