Python Turtle Graphics

  

This question tests your understanding of Block 1 Part 2Design and implement a single program:.to produce a simple graphical representation of a set of triangles, as shown in Figure 1. The output should consist of four triangles with sides of length 20, 40, 60 and 80, respectively, placed vertically as shown. Other than the top triangle, the top of each triangle should be exactly halfway along the baseline of the triangle abovethat, in principle, can produce larger numbers of triangles simply by changing one number that specifies the number of triangleswith the turtle starting at the position that we want to be the bottom left-hand corner of the bottom-most triangle and the turtle pointing to the right.a.Produce a top-level decomposition, making use of exactly one loop. At this stage, express your answer in terms of two sub-problems.(4 marks)b.Refine your decomposition to give an algorithm. As you include extra detail, make use of a second loop.(8 marks)c.Translate your algorithm into Python, including appropriate comments, and run your program to ensure the output matches Figure 1. You do not need to submit an output. Name your Python file Q2_OUCU.py, where ‘OUCU’ is your OU computer username (e.g. abc123). Write your code in this file. Then include the code file in your TMA zip file. Paste your completed Python code into your solution document as text and state whether it is successful in producing the required output.Your answer must be a translation of your algorithm from Part (b), otherwise no marks will be awarded.Use techniques and language features that are covered in the module. If you decide to use techniques or language features not covered in the module, you must give a justification for this or no marks will be given.(13 marks) Image transcription textPython Turtle Graphics… Show more Computer Science Engineering & Technology Python Programming COMMPUTING TM112

Don't use plagiarized sources. Get Your Custom Essay on
Python Turtle Graphics
Just from $13/Page
Order Essay
  

Leave a Reply

Your email address will not be published.

Related Post

Open chat
💬 Need help?
Hello 👋
Can we help you?