Question: C. Translate your algorithm into Python, including appropriate comments, and run your program the output matches Figure 1. You do not need to submit

the output matches Figure 1. You do not need to submit an output Name your Python file Q2 OUCU.py.Translate your algorithm i

Design and implement a single program:• to produce a simple graphical representation of a setof triangles, as shown in Figu

Your answer must be a translation of your algorithmfrom Part (b), otherwise no marks will be awarded.Use techniques and lan  
 

C. Translate your algorithm into Python, including appropriate comments, and run your program the output matches Figure 1. You do not need to submit an output. Name your Python file Q2_OUCU.py. code file in your TMA zip file. Paste your completed Python code into your solution document as text and where 'OUCU' is your OU computer username (e.g. abc123). Write your code in this file. Then include the 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) re 1 Triangles graphic orke) KKK Design 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 above that, in principle, can produce larger numbers of triangles simply by changing one number that specifies the number of triangles with 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) Python Turtle Graphics

Step by Step Solution

3.30 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import turtle create turtle object t turtleTurtle make turtle ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

635dba8963525_178371.pdf

180 KBs PDF File

Word file Icon

635dba8963525_178371.docx

120 KBs Word File

Students Have Also Explored These Related Marketing Questions!