Tuesday 4 July 2017

Text-based programming Lesson 5 - Procedures

Text-based programming  Lesson 5 - Procedures

A procedure is a block of instructions that carry out a task.  Procedures are useful if a task is to be carried out a number of times.  It means that the programming for that procedure does not have to be written out lots of times, saving file size and time!


Objectives and Outcomes:

  • be able to explain what a procedure is (band 4)
  • apply your understanding to create a program that uses a procedure (band 5)
  • link what you have learned and done today to an example in real-life where a procedure has been used by you on a computer (band 6)
You are going to write a procedure that draws a smiley face.

The link to the program to do this is below:


See the link below for a screenshot of the programming:

https://docs.google.com/document/d/1ROCN3A_cinkvzr_bcpBXCV_XCT5PD_GjhD09ubXnoO8/edit?usp=sharing

1.  On a new blog post, titled the same as this one, write an explanation of what a procedure is and why it is useful.

2.  Using my Google doc with screenshot, write the smiley face procedure.

3.  Paste a screenshot of your working program on a Google doc, correctly shared to Anyone with the Link.

4.  Now adapt your program so that the face is a different colour (but not black!)

5.  Paste a screenshot of this onto your Google doc, below the previous one.

6.  Now adapt your program to match my second screenshot (lower down on my Google doc you have already opened).  This is using variables to allow you to draw different smiley faces in different positions.

7.  Try to work out how to run the procedure so that it adds 3 more smiley face procedures in different parts of the screen.  They can be the same colour or different - it's up to you.  
Hint: Think of your screen as an invisible grid where you need to use co-ordinates to re-position each smiley face when you click Run.

8.  Paste a screenshot of this onto your Google doc, below the previous one.

9.  Copy/paste the link to your google doc onto your blog post, if you haven't already done so.

Publish!



No comments:

Post a Comment