This is a programming task from an OCR exam called the Entry Level Certificate in Computing.
A square of sides 10 can be drawn with a pen using the following instructions:
Move forward 10
Turn right 90 degrees
By repeating the process of drawing a square, turning slightly and drawing a bigger square it is possible to draw patterns.
A printing company wants to draw these patterns so they can put them on T-Shirts. You are going to write a drawing program to create patterns for the company.
Where you are asked to give evidence of your program you should print out or produce a screenshot of your program. You should check your program works at every stage but only need to give proof of testing in section (i).
Your program will:
Ask how many squares to draw.
If the user chooses a number less than 15 picks a red pen otherwise black.
List what your drawing program must be able to do. Make a plan for the drawing program. (You can use flowcharts, pseudo code or any other sensible method of showing how your program will work.)
Write a program that selects a black coloured pen.
Add to the program so that after selecting the pen colour it then draws a square with sides of length 20 and returns to its original position. (A reminder the steps for doing this are shown on the previous page.)
Test what you have made works then give evidence of your program blocks.
After drawing the square make the sprite turn 13 degrees.
Add to the program so it repeats the process of drawing a square and turning 20 times.
Add to the program so it increases the size of the sides of the square by 5 each time it draws a new one.
Add to the program so it asks the user how many squares the user wants and then draws the squares that number of times.
Change your program so when it asks for the number of squares if the user picks a number of less than 15 a red pen is selected.
Test that your program works. Make notes on how you tested it and what you found out.
Write an evaluation of how well your program works. You should include: Any problems you had making it and how you overcame them. Any bugs your program still has. Any future improvements that could be made to your program.