Tuesday 6 June 2017

Text-based programming - Lesson 2

Objectives and Outcomes:

  • be able to explain what repetition is (band 4)
  • apply your understanding to create a program that uses repetition (band 5)
  • link what you have learned and done today to previous lessons where you have used repetition (band 6)

Computer programs like we did yesterday, drawing shapes, often need you to repeat the same sequence of instructions lots of times.  This is not very efficient!  It takes longer to type the instructions, you are more likely to make a mistake in typing, it's harder to find a mistake amongst all the lines of words and it takes up more memory as it's a bigger file of information.  Also, you would have to make lots of changes to your program if you wanted to change the end product, eg the size of your shape.

Programmers can use loops to repeat instructions.

Look at my screenshot of my program to draw a square using a loop:

https://docs.google.com/document/d/1_XxMothEdvVTzOs0UrkvW_PoXQxC-3ClUawxUb-9bV0/edit?usp=sharing

Your tasks

1.  On a new blog post, explain what repetition is and why it is inefficient.

2.  Explain what a loop is.


3.  Using my programming screenshot, use a loop to draw the following shapes:


  • a square
  • an equilateral triangle
  • a regular pentagon (5 sides)
  • a regular hexagon (6 sides)

Make sure you take a screenshot of each successful program and paste them to a Google doc.

Here is the link you need to get to the turtle programming:

https://repl.it/languages/python_turtle

4.  Share your Google doc to Anyone with the link and paste the link to your blog post underneath the writing you did at the start of the lesson.
Publish!



No comments:

Post a Comment