i.First write a decomposition for the extended problem, based on the description in Box 1 above. This should be at a similar level of detail to the one given in the discussion to Activity 2.21 of Block 3 Part 2. The first sub-problem should be to set up a glossary, as before, but the rest of the decomposition needs modifying to reflect the extension to the problem. ii.Expand the part of the algorithm that deals with user interaction by instantiating the interactive loop Pattern 2.1 from Block 3 Part 2. You can see an example of this pattern being instantiated in the discussion for Activity 2.23; although, of course, your instantiation will be slightly different because the problem has changed. You can assume that, when asked if they know a definition, the user will always answer either y or n. iii.Briefly discuss how you will test the program. Only a short answer is required and you do not need to give examples, only describe what approach you will follow. iv.Now you will implement the instantiated pattern as Python code. We have provided a starter script, which is included in the download for this TMA as Q2.py. Begin by saving a copy of the provided program as Q2_OUCU.py (where OUCU is your OU computer username, e.g. abc123).
-
i.First write a decomposition for the extended problem, based on the description in Box 1 above. This should be at a similar level of detail to the one given in the discussion to Activity 2.21 of Block 3 Part 2. The first sub-problem should be to set up a glossary, as before, but the rest of the decomposition needs modifying to reflect the extension to the problem.
-
ii.Expand the part of the
algorithm that deals with user interaction by instantiating the interactive loop Pattern 2.1 from Block 3 Part 2. You can see an example of this pattern being instantiated in the discussion for Activity 2.23; although, of course, your instantiation will be slightly different because the problem has changed.You can assume that, when asked if they know a definition, the user will always answer either y or n.
-
iii.Briefly discuss how you will test the program. Only a short answer is required and you do not need to give examples, only describe what approach you will follow.
-
iv.Now you will implement the instantiated pattern as Python code.
We have provided a starter script, which is included in the download for this TMA as Q2.py. Begin by saving a copy of the provided program as Q2_OUCU.py (where OUCU is your OU computer username, e.g. abc123).
The starter script is a modified version of the first complete version of the flashcard program, as developed in Block 3 Part 2. The definition of show_flashcard() is unchanged, as is the code that sets up the glossary, and you should not alter these parts of the program in any way.
Complete the new version of show_flashcard() by adding code, where indicated by comments, that will implement the algorithm you produced in Part (ii). You should use appropriate comments to make it clear how the code you have written corresponds to the steps in the algorithm.
Important: also make sure you write a suitable docstring for the modified program, to reflect the additional behaviour.
Copy the complete program into your Solution Document. Also include your completed .py file in your TMA zip file.
Step by step
Solved in 2 steps