Y9 Programming


Previous Topic

Computer Science


Next Topic

Character Design

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.

scratch challenge 1_1.mp4

Task 2

Loops

Scratch Challenge 1_2.mp4

Task 3

Conditions and Comparisons

Scratch Challenge 1_3.mp4

Task 4

Input

Scratch Challenge 1_4.mp4

Task 5

Input (more)

Scratch Challenge 1_5.mp4

Apply your knowledge

Task 6

Draw

Scratch Draw 1_6.mp4

Task 7

Multiplication Quiz (click on image)

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.

5 Most Famous Computer Bugs

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.........

  1. Whenever you press the B key, the sprite gets a little bigger. Whenever you press the S key, the sprite gets a little smaller.

  2. Whenever the sprite hears a loud sound, it changes color.

  3. Whenever the sprite is in the top 25% of the screen, it says “I like it up here.”

  4. When the sprite touches something blue, it plays a high note. When the sprite touches something red, it plays a low note.

  5. Whenever two sprites collide, one of them says: “Excuse me.”

  6. Whenever the cat sprite gets near the dog sprite, the cat turns and runs away from the dog.

  7. Whenever you click on the background, a flower appears at that spot.

  8. Whenever you click on a sprite, all other sprites do a dance.

  9. When the score reaches 10, the scene (background) changes.

  10. The sprite falls as if controlled by gravity, but stops when hits the green ground.

  11. The sprite follows the mouse-pointer, but it never gets too close to the mouse-pointer.

  12. 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

Scratch to Python

This doc will show you some of the functions you can do in both scratch and python.

This page will take you to our Year 10 course.

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

Fundamentals Answers

Drawing Answers

Multiplication Answers

Debug Answers