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...
-
Use the F table to determine the value beyond which you would find a. 1% of the values, if numerator degrees of freedom = 2 and denominator degree of freedom = 15. b. 5% of the values, if numerator...
-
How does context of use shape the form and functions of a gamified system?
-
On April 30, 2008, Pound Corp. purchased for cash all 200,000 shares of the outstanding common stock of Shake Corp. for \($20\) per share. At April 30, 2008, Shakes balance sheet showed net assets...
-
Nature's Best Publishing Company pays its employees monthly. Payments made by the company on October 31, 2016, follow. Cumulative amounts paid to the persons named prior to October 31 are also given....
-
What is the swap rate for a 10-year semi-annual swap? Assume that all zero rates are continuously compounded. You can use the same zero rates for discounting and for calculating implied swap cash...
-
Laval produces lighting fixtures. Budgeted Information for Its two production departments follows. The departments use machine hours (MH) and direct labor hours (DLH). Overhead cost Direct labor...
-
Question 8 Let X1, X2,,Xn (n i.i.d random variables) be uni- formly distribution over [0, 0] Unif [0, 0]. It was shown in classes that max(X1, X2, Xn) is a biased MLE of 0. Two other estimators of 0...
-
1. Cement Manufacturer An Indonesian leading cement manufacturing company has five production plants and a large stockists base. The company produces different types of cement and sells it under a...
-
briefly describe a healthcare organization and a specific regulatory mandate that effects this organization. Then explain the strategies the organization uses to comply with the mandate. Finally,...
-
For Problem 12: Let {E} be a sequence of subsets in Rn, each of outer measure zero, namely, |Ek|e = 0, k = 1, 2, . . . ..... A = lim inf Ek, B = lim sup Ek, k kx show that |A| = |B|e = 0. e
-
1. What is meant by "improved decision-making"? Explain the ways in which operations management can contribute to this. Provide examples if deemed necessary. 2. What are the differences between terms...
-
Im in intro to programming so not adavnced coding. Just thebasics.On a 500 by 500 canvas, create an image of 1000 circles, each ofwhich has a random color, a random center anywhere within thecanva 2...
-
What are technical skills At what level are they most important and why?
-
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.
-
Rewrite \(9 \frac{5}{14}\) as an improper fraction.
-
Correctly apply the rules for the order of operations to accurately compute \(\left(\frac{3}{5}+2 ight) \times\left(\frac{4}{5}-\frac{1}{2} ight)^{2} \div \frac{11}{15}\).
-
Demonstrate the density property of rational numbers by finding a rational number between \(\frac{27}{13}\) and \(\frac{21}{10}\).
Study smarter with the SolutionInn App