Y9 Programming
He iti hau marangai e tū te pāhokahoka
There may be a little storm, but in the end there is a rainbow - Persevere and at the end there will be a great reward.
Computer programming is a way of giving computers instructions about what they should do next. These instructions are known as code, and computer programmers write code to solve problems or perform a task.
The end goal is to create something: that could mean anything from a web page, or a piece of software, or even just a pretty picture. That’s why computer programming is often described as a mix between art and science; it’s technical and analytical, yet creative at the same time.
LEARN The Fundamentals of Programming
This first stage is to learn the basics of programming using Scratch so that we can start to write more complicated programs.
The key areas you need to know and understand are:
Variables
Loops
Conditionals & Comparisons
Input
To begin create an account in Scratch or sign in using an existing account you have
Task 1 - Variables
Variables are the building blocks of any computer code. Variable can hold all sorts of data including numbers, letters, strings (word or sentences), and even large data files like pictures and sound files.
These bits of data can change when a program runs which is what they are called variable. For instance a score can go up and down as you play a game.
Task 2
Loops
Task 3
Conditions and Comparisons
Task 4
Input
Task 5
Input (more)
Apply your knowledge
Task 6 Extra information:
To get the pen tool option. At the bottom left of your scratch application click this button -->
<-- Lots of options come up and you choose pen at this point.
TASK 8 - Debugging Scratch
Finding errors is a vital skill for any programmer. There are six short pieces of code that are not working properly. You need to make them yourself and figure out what is going wrong.
SCRATCH PROGRAMMING ASSESSMENT
You need to make a Guessing Game Programme
You can find the instructions in the document.
Make sure your programme works first and then make it look good if you have time!
FURTHER RESOURCES
Quick exercises to test your programming ability
Can you get scratch to.........
Whenever you press the B key, the sprite gets a little bigger. Whenever you press the S key, the sprite gets a little smaller.
Whenever the sprite hears a loud sound, it changes color.
Whenever the sprite is in the top 25% of the screen, it says “I like it up here.”
When the sprite touches something blue, it plays a high note. When the sprite touches something red, it plays a low note.
Whenever two sprites collide, one of them says: “Excuse me.”
Whenever the cat sprite gets near the dog sprite, the cat turns and runs away from the dog.
Whenever you click on the background, a flower appears at that spot.
Whenever you click on a sprite, all other sprites do a dance.
When the score reaches 10, the scene (background) changes.
The sprite falls as if controlled by gravity, but stops when hits the green ground.
The sprite follows the mouse-pointer, but it never gets too close to the mouse-pointer.
The sprite follows a red line.
Sprite is a computer science way of saying picture. You may want to use the Scratch Cat for any that require a sprite.
Some Fun Games to Create
Pong in Scratch
Tic Tac Toe
Snake Game
Space Invaders Game
Introduction to Python
NZ CURRICULUM
Digital Technologies | Progress Outcomes
Computational thinking for digital technologies
The progress outcomes describe the significant learning steps that students take as they develop their expertise in computational thinking for digital technologies.
At the end of this topic students will have had the opportunity to cover;
understand that there can be more than one algorithm for the same problem PO3
decompose problems into step-by-step instructions to create algorithms for computer programs PO3
use logical thinking to predict the behaviour of the programs PO3
develop and debug simple programs that use inputs, outputs, sequence, and iteration PO3
students decompose problems to create simple algorithms using the three building blocks of programming: sequence, selection, and iteration PO4
implement these algorithms by creating programs that use inputs, outputs, sequence, basic selection using comparative operators, and iteration PO4
debug simple algorithms and programs by identifying when things go wrong with their instructions and correcting them PO4
be able to explain why things went wrong and how they fixed them PO4
evaluate the efficiency of algorithms PO4
recognise that computers need to search and sort large amounts of data PO4
They also evaluate user interfaces in relation to their efficiency and usability P04
students independently decompose problems into algorithms. They use these algorithms to create programs with: inputs, outputs, sequence, selection (using: comparative and logical operators, variables of different data types), iteration. P05
determine when to use different types of control structures. They document their programs, using an organised approach for testing and debugging P05
develop programs considering human-computer interaction (HCI) heuristics P05
Teacher Answers to Challenges