Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question provides an opportunity for you to demonstrate your understanding of the problem-solving approach taught in TM112 and the patterns introduced in Block 1
This question provides an opportunity for you to demonstrate your understanding of the problem-solving approach taught in TM112 and the patterns introduced in Block 1 Part 4 and Block 2 Part 2. You can find an overview of the problem-solving approach and a list of all the patterns TM112 teaches in the Problem solving and Python quick reference and you will need to refer to this document as you work on the question. We have provided to problems for you to work with. For each problem you are asked to carry out the six steps listed below. 1. Provide a high-level decomposition. This should do no more than break the problem into the main subproblems. It is a description of what the solution needs to do without going into the detail of how it will be done. As a rather fanciful example, if you were planning a mission to collect rock samples from the Moon a high-level decomposition could be > collect Moon rocks >> Fly to Moon >> Land >> collect rock samples >> Return to Earth As you see this leaves out all the detail of things like distances and velocities and just gives the big picture. Of course, your decompositions will be very different, but we hope the example gives a feel for the level of detail appropriate in a high-level decomposition. 2. Say what the inputs and outputs of the problem are. 3. Write two tests for the problem. Present the tests in a table, with a column for each input and output, and an extra column with a brief explanation of why you selected each test (as is done in Block 2 Part 2 Activity 2.10, for example). 4. Identify which of the TM112 pattern or patterns should be applied to the solution of the problem. State clearly the name of the pattern and the pattern number, for example "List generation Pattern 2.2". A list of all the patterns can be found in the Problem solving and Python quick reference 5. Write an algorithm for the problem by instantiating the pattern you have chosen. 6. Implement your algorithm as Python code. This must match the steps of your algorithm and you should use comments in the code to make it clear how the two correspond. Marks will be lost if the program does not follow the algorithm. Name your Python file Q2_problem_X_OUCU.py, where OUCU is your OU computer username, e.g. abc 123 and X is either a or b, depending on the specific problem the code relates to 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 (with indentation This question provides an opportunity for you to demonstrate your understanding of the problem-solving approach taught in TM112 and the patterns introduced in Block 1 Part 4 and Block 2 Part 2. You can find an overview of the problem-solving approach and a list of all the patterns TM112 teaches in the Problem solving and Python quick reference and you will need to refer to this document as you work on the question. We have provided to problems for you to work with. For each problem you are asked to carry out the six steps listed below. 1. Provide a high-level decomposition. This should do no more than break the problem into the main subproblems. It is a description of what the solution needs to do without going into the detail of how it will be done. As a rather fanciful example, if you were planning a mission to collect rock samples from the Moon a high-level decomposition could be > collect Moon rocks >> Fly to Moon >> Land >> collect rock samples >> Return to Earth As you see this leaves out all the detail of things like distances and velocities and just gives the big picture. Of course, your decompositions will be very different, but we hope the example gives a feel for the level of detail appropriate in a high-level decomposition. 2. Say what the inputs and outputs of the problem are. 3. Write two tests for the problem. Present the tests in a table, with a column for each input and output, and an extra column with a brief explanation of why you selected each test (as is done in Block 2 Part 2 Activity 2.10, for example). 4. Identify which of the TM112 pattern or patterns should be applied to the solution of the problem. State clearly the name of the pattern and the pattern number, for example "List generation Pattern 2.2". A list of all the patterns can be found in the Problem solving and Python quick reference 5. Write an algorithm for the problem by instantiating the pattern you have chosen. 6. Implement your algorithm as Python code. This must match the steps of your algorithm and you should use comments in the code to make it clear how the two correspond. Marks will be lost if the program does not follow the algorithm. Name your Python file Q2_problem_X_OUCU.py, where OUCU is your OU computer username, e.g. abc 123 and X is either a or b, depending on the specific problem the code relates to 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 (with indentation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started