C. Translate your algorithm into Python, including appropriate comments, and run your program the output matches...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
import turtle create turtle object t turtleTurtle make turtle ... View the full answer
Related Book For
Understanding Basic Statistics
ISBN: 978-1111827021
6th edition
Authors: Charles Henry Brase, Corrinne Pellillo Brase
Posted Date:
Students also viewed these marketing questions
-
In an applied research context you do not need to explain the relationships between the variables in your conceptual model. Discuss this statement.
-
In an applied research context you do not need to explain the relationships between the variables in your conceptual model. Discuss this statement. (2-3 paragraphs).
-
You do not need a lot of money to invest in a mutual fund. However, if you decide to put some money into an investment, you are usually advised to leave it in for (at least) several years. Why?...
-
Instructions: Read the footnotes included in the financial statements for H & B Bakery, then answer the following questions. *The exact requirement of this question, is to read the statements below...
-
After performing a 3 4 ANOVA with equal ns, you find that all Fs are significant. What other procedures should you perform?
-
A good refrigerant should have (a) High viscosity and low thermal conductivity (b) Low viscosity and high thermal conductivity (c) High viscosity and high thermal conductivity (d) Low viscosity and...
-
Spice Inc. issued bonds payable on December 31. Spice's bonds were dated July 31. Which statement is true of Spice's journal entry to record issuance of the bonds payable? a. Spice must pay one...
-
The following information pertains to the City of Williamson for 2020, its first year of legal existence. For convenience, assume that all transactions are for the general fund, which has three...
-
Topper Sports, Incorporated, produces high-quality sports equipment. The company's Racket Division manufactures three tennis rackets-Standard, Deluxe, and Pro-widely used in amateur play. Selected...
-
Over the past several years, Claire Jackson, CEO and founder of Easy Learning (EL), has been working to expand operations outside of Canada. In particular, she has placed two longtime, trusted...
-
all the and mAnima,local saddle point ok And local minima the function. fly,y)
-
Two individuals, Catherine and Annabelle, wish to make exchanges. Catherine has three pencils and Annabelle also has three. Catherine values successive units of pencil as follows: $6, $5, $4, $3, $2,...
-
1. What is the purpose of the Statement of Cash Flows? 2. What are the three major classifications of cash flows in the Statement of Cash Flows? If you could pick, which one would you prefer your...
-
You have just completed the appraisal of an office building and have concluded that the market value of the property is $3,500,000. You expect Potential Gross Income (PGI) in the first year of...
-
Garden Sales, Inc., sells garden supplies. Management is planning its cash needs for the second quarter. The company usually has to borrow money during this quarter to support peak sales of lawn care...
-
10. A train traveling at a constant speed rounds a curve of radius 250. m. The curve starts with the train heading north and ends with the train heading west. A chandelier suspended from the ceiling...
-
3. A 8.00 m long uniform ladder with a mass of 14.5 kg is placed against a frictionless wall so that it makes an angle of 65 with the ground. Bob, a 62.0 kg man, is standing on the ladder 2.50 m from...
-
What is the difference between direct materials and indirect materials?
-
The following data represent trunk circumferences (in mm) for a random sample of 60 four-year-old apple trees at East Malling Agriculture Research Station in England (Reference: S. C. Pearce,...
-
A vending machine automatically pours soft drinks into cups. The amount of soft drink dispensed into a cup is normally distributed with a mean of 7.6 ounces and standard deviation of 0.4 ounce....
-
Compute P8,3.
-
In a chemical process plant, water at 67C is pumped from a storage tank at the rate of 20,000 kg/hr. The motor for the pump expenses work at the rate of 1.5 hp. The water passes through a heat...
-
Prove that \(C_{P}>C_{V}\), where the notations have their usual meanings.
-
Derive an expression for the work done if an ideal gas undergoes an adiabatic change.
Study smarter with the SolutionInn App