Question 2 You must give a word count for any question part with a maximum word limit. This question tests your understanding of Block 3 Part 2 and, more generally, the problem-solving and Python programming skills that are covered by the module. The question is concerned with a variation of the flashcard problem you studied in Block 3 Part 2. You will find it useful to read through the whole question before starting to answer it. In the original flashcard problem, the cards are designed to help a user improve their familiarity with a glossary of terms. The user can ask the program to show an entry picked randomly from a glossary. When the user presses return, the program shows the definition corresponding to that entry. The user is then given the option of seeing another entry or quitting. Another common use of flashcards is to help someone learning a language practise their vocabulary. Someone learning French, for example, might have a set of cards with English words on one side and their French equivalents on the other. They pick a random card, read one side and then see if they can remember what's on the other side, as illustrated in Figure 1. Figure 1 A flashcard with an English word on one side and its French equivalent on the other. In this question you will adapt a version of the glossary flashcards program to become an English to French vocabulary tester. Box 1 – the problem The program should allow the user to ask for a word list entry. In response, the program should randomly pick an entry from the word list. It should display the English word and invite the user to enter the French equivalent. After the user enters their answer, the program should check the answer. If it is correct the program should tell the user; otherwise, if the answer is wrong the program should tell the user and inform them of the correct answer. The user should be able to repeatedly ask for an entry and also have the option to quit the program instead of seeing another entry. A sample session might run like this: Enter s to show a flashcard and q to quit: s What is the French for red: rouge Correct, well done! Enter s to show a flashcard and q to quit: s What is the French for yellow: vert Sorry, the answer is jaune Enter s to show a flashcard and q to quit: s What is the French for white: blanc Correct, well done! Enter s to show a flashcard and q to quit: s What is the French for yellow: jaune Correct, well done! Enter s to show a flashcard and q to quit: q >>> For the purposes of developing the program we will use a small word list with just six entries: the name of a colour in English, and its French equivalent. Box 2 – keeping a notebook As you work through part a. of this question you should keep a notebook. You will need this for your answer to part a.iv. This should be very brief: it is simply a record of your personal experience while working on the task and what you feel you have learned from it. In your notebook we suggest that you record the following information: How A brief description of how you went about the task. Resources What documentation, if any, you consulted (including course materials and any online sources) and which you found most useful. There is no need for full references, just note the source, and – in the case of the course materials – what the relevant part and section or activity was. Difficulties Anything you found difficult about the task, and how you dealt with it. Lessons learned Anything you learned from the task that would be useful if you faced a similar problem in the future. • a.We have provided a Python file Word_List_Flashcards.py that you should work from when answering this question. If you read this program and run it you will find it is exactly the same as Flashcards_First_Complete_Version.py, except that we have replaced the glossary dictionary and all references to it with a dictionary word_list, which is an English–French word list, and added a comment in the show_flashcard() function. o i.Write an algorithm for the following section in Box 1, reproduced here for convenience. The program should allow the user to ask for a word list entry. In response, the program should randomly pick an entry from the word list. It should display the English word and invite the user to enter the French equivalent. After the user enters their answer, the program should check the answer. If it is correct the program should tell the user, otherwise, if the answer is wrong the program should tell the user and inform them of the correct answer. Your algorithm should provide a similar level of detail to the show flashcard algorithm in Subsection 2.5.2 of Block 3 Part 2. 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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
100%
Question 2 You must give a word count for any question part with a maximum word limit. This question tests your understanding of Block 3 Part 2 and, more generally, the problem-solving and Python programming skills that are covered by the module. The question is concerned with a variation of the flashcard problem you studied in Block 3 Part 2. You will find it useful to read through the whole question before starting to answer it. In the original flashcard problem, the cards are designed to help a user improve their familiarity with a glossary of terms. The user can ask the program to show an entry picked randomly from a glossary. When the user presses return, the program shows the definition corresponding to that entry. The user is then given the option of seeing another entry or quitting. Another common use of flashcards is to help someone learning a language practise their vocabulary. Someone learning French, for example, might have a set of cards with English words on one side and their French equivalents on the other. They pick a random card, read one side and then see if they can remember what's on the other side, as illustrated in Figure 1. Figure 1 A flashcard with an English word on one side and its French equivalent on the other. In this question you will adapt a version of the glossary flashcards program to become an English to French vocabulary tester. Box 1 – the problem The program should allow the user to ask for a word list entry. In response, the program should randomly pick an entry from the word list. It should display the English word and invite the user to enter the French equivalent. After the user enters their answer, the program should check the answer. If it is correct the program should tell the user; otherwise, if the answer is wrong the program should tell the user and inform them of the correct answer. The user should be able to repeatedly ask for an entry and also have the option to quit the program instead of seeing another entry. A sample session might run like this: Enter s to show a flashcard and q to quit: s What is the French for red: rouge Correct, well done! Enter s to show a flashcard and q to quit: s What is the French for yellow: vert Sorry, the answer is jaune Enter s to show a flashcard and q to quit: s What is the French for white: blanc Correct, well done! Enter s to show a flashcard and q to quit: s What is the French for yellow: jaune Correct, well done! Enter s to show a flashcard and q to quit: q >>> For the purposes of developing the program we will use a small word list with just six entries: the name of a colour in English, and its French equivalent. Box 2 – keeping a notebook As you work through part a. of this question you should keep a notebook. You will need this for your answer to part a.iv. This should be very brief: it is simply a record of your personal experience while working on the task and what you feel you have learned from it. In your notebook we suggest that you record the following information: How A brief description of how you went about the task. Resources What documentation, if any, you consulted (including course materials and any online sources) and which you found most useful. There is no need for full references, just note the source, and – in the case of the course materials – what the relevant part and section or activity was. Difficulties Anything you found difficult about the task, and how you dealt with it. Lessons learned Anything you learned from the task that would be useful if you faced a similar problem in the future. • a.We have provided a Python file Word_List_Flashcards.py that you should work from when answering this question. If you read this program and run it you will find it is exactly the same as Flashcards_First_Complete_Version.py, except that we have replaced the glossary dictionary and all references to it with a dictionary word_list, which is an English–French word list, and added a comment in the show_flashcard() function. o i.Write an algorithm for the following section in Box 1, reproduced here for convenience. The program should allow the user to ask for a word list entry. In response, the program should randomly pick an entry from the word list. It should display the English word and invite the user to enter the French equivalent. After the user enters their answer, the program should check the answer. If it is correct the program should tell the user, otherwise, if the answer is wrong the program should tell the user and inform them of the correct answer. Your algorithm should provide a similar level of detail to the show flashcard algorithm in Subsection 2.5.2 of Block 3 Part 2. 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.
07:23
12345
Word_List_Flash...
SAF:uk.ac.open.oust...
1 # Starter file for TM112 2022J TMA03 Q2
23456
5
This flashcard program allows the user to ask
for a word_list entry.
15
6
In response, the program randomly picks an
entry from all word_list
7
entries. It shows the entry. After the user
presses return, the
8
program shows the definition of that
particular entry.
9 The user can repeatedly ask for an entry and
also
10
has the option to quit the program instead of
seeing
11 another entry.
12
13
14 from random import *
16 # IMPORTANT
21
22
23 def show_flashcard():
24
25
26
N
17 # Q2 (a)(iii) Make changes only to
18 # -- the docstring for the program as a whole.
# -- the docstring of the show_flashcard()
function
19
20
# -- the body of the show_flashcard() function.
Tab |
3
them
all 84%
Show the user a random key and ask
to define it. Show the definition
when the user presses return.
|||
:
#
Transcribed Image Text:07:23 12345 Word_List_Flash... SAF:uk.ac.open.oust... 1 # Starter file for TM112 2022J TMA03 Q2 23456 5 This flashcard program allows the user to ask for a word_list entry. 15 6 In response, the program randomly picks an entry from all word_list 7 entries. It shows the entry. After the user presses return, the 8 program shows the definition of that particular entry. 9 The user can repeatedly ask for an entry and also 10 has the option to quit the program instead of seeing 11 another entry. 12 13 14 from random import * 16 # IMPORTANT 21 22 23 def show_flashcard(): 24 25 26 N 17 # Q2 (a)(iii) Make changes only to 18 # -- the docstring for the program as a whole. # -- the docstring of the show_flashcard() function 19 20 # -- the body of the show_flashcard() function. Tab | 3 them all 84% Show the user a random key and ask to define it. Show the definition when the user presses return. ||| : #
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,