Design and implement a single program:
- to produce a simple graphical representation of a set of nested squares, as shown in Figure 1. The output should comprise of 4 squares. The squares should have sides of length 20, 40, 60 and 80, respectively
- that, in principle, can produce larger numbers of nested squares simply by changing one number that specifies the number of squares
- with the turtle starting at the position that we want to be the top left hand corner of the innermost square and the turtle pointing to the right.
You should produce a program that, in principle, can produce larger numbers of nested squares simply by changing one number that specifies the number of squares.
You should assume that the turtle starts at the position we want to be the top left hand corner of the innermost square and is pointing to the right.
- a.Produce a top level decomposition, making explicit 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 explicit use of a second loop.(8 marks)
- c.This part of the question involves writing Python code. Name your Python file TM112_TMA01_Q3_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.(13 marks)
Translate your algorithm into Python and run your program to ensure the output matches Figure 1. You do not need to submit output.
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.