Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We have provided a Python file Proverbs _ Flashcards _ 2 3 J . py that you should work from when answering this question this
We have provided a Python file ProverbsFlashcardsJpy that you should work from when answering this question this is on the Assessment page of the module website. Please note that we have not updated the comments to reflect the code changes one of your tasks will be to do that.
If you read this program, you will find it is essentially the same as FlashcardsFirstCompleteVersion.py except that we have replaced the glossary dictionary and all references to it with a dictionary proverbsdictionary. The keys in this dictionary are proverbial phrases missing the last word, and the values are the missing final words. If you run it at this point, it behaves just like FlashcardsFirstCompleteVersion.py except it shows incomplete phrases and missing words, rather than glossary terms and their definitions.
iWrite an algorithm for the following section from Box reproduced here for convenience.
The program should allow the user to ask for an entry from a list of proverbial phrases, each of which is missing the last word always represented by six hyphens In response, the program should randomly pick an entry from the list. It should then display the incomplete phrase and invite the user to supply the missing word. When user enters a word, the program should check to see if it is correct. If so the program should congratulate the user. Otherwise, the program should tell the user they were wrong and display the phrase with the missing word filled in
Your algorithm should provide a similar level of detail to the show flashcard algorithm in Section of Block Part Your algorithm should resemble the one shown there, except that the user will need to do more than just press return, and the program will have to evaluate the user response and act accordingly.
iiExplain briefly how you will test the program. Only a short answer is required, and you do not need to give examples, only describe in a few lines what approach you will follow.
iii.Now you will implement your algorithm as Python code, modifying the provided Python program ProverbsFlashcardsJpy
Complete a new version of showflashcard by modifying the code so it implements the algorithm you produced in part ai
Also modify the docstring for the showflashcard function and the docstring for the program as a whole, to take account of the changed functionality and behaviour.
Important: Do not make changes to any other parts of the program.
When you have made the required changes, run the program to test it
Copy your modified program, as text, into your solution document.
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