Question 5
Edexcel Computer Science June 2025 Paper 2GCSE15 marks
On the specification
- 6.2 Program constructs6.3 Data types and structures6.6 Subprograms
Question text
5 A program is being developed to display nine coloured circles using turtle graphics. Here is a greyscale image of the output produced by a fully functional program. Line B Line A Line D Line C Circle 1 The lines • The starting point for: – line A is (−200, 0) – line B is (0, 200). • Lines A and B are 400 units long. • The starting point for: – line C is (−200, −200) – line D is (200, −200). • Lines C and D are at 45 degrees and 566 units long. • The lines are drawn in black with a width of three units. The circles • There are nine coloured circles. • All circles have a radius of 75 units. • The position of circle 1 is stored in the variables xPos and yPos. • The second circle is located at xPos + 30 and yPos + 30. • The circle colours are stored in a one-dimensional array. Each colour is used in sequence. The colours of the circles will be the same each time the program is run. • The width of the line to draw a circle is a random integer between five and ten. The width of the line may be different for each circle and may be different each time the program is run. The turtle • The speed of the turtle must be as quick as possible. The graphics screen • The code to create the graphics screen is provided. • The code to keep the graphics screen open is provided. Open file Q05.py Amend the code to create the image shown. Use comments, white space and layout to make the program easier to read and understand. Use the constants, variables and existing code provided. Do not add any additional functionality. Save your amended code file as Q05FINISHED.py (Total for Question 5 = 15 marks)