Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

In our variant the program is designed to help people who want to learn the symbols for chemical elements. Every element has a symbol, a one or two letter abbreviation used to represent it. For example, the symbol for Hydrogen is H, that for Oxygen O, Calcium Ca, and Silicon Si.

For most elements the symbol is not hard to remember, because the connection between the name of an element and its chemical symbol is fairly obvious, as in the examples above. However, there are eleven elements for which the connection between name and symbol appears rather mysterious, making them hard to learn. For example the symbol for Tungsten is W. The reason for these unexpected symbols is that they are derived from the name of the element in some other language. For instance, W comes from the German name for Tungsten, which is Wolfram.

Our program is intended to help a learner become familiar with the symbols for these eleven elements that have unexpected symbols.

Box 1 – The problem
The program should allow the user to ask for an entry from the list of the eleven elements with unexpected names. In response, the program should randomly pick an entry from the list. It should display the name of the element and invite the user to enter the corresponding symbol.

After the user enters their answer, the program should check the answer. If it is correct the program should congratulate the user, and then remove that element from the list (so once the user gets a symbol right, they don't get asked about that element again, unless they rerun the program, of course.)

Otherwise, if the answer is wrong the program should tell the user and inform them of the correct symbol for that element.

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. If they request another entry but the list is empty by this time the program should quit anyway.

A sample dialogue might run as follows.

What is the symbol for Sodium: K

Sorry that is wrong. The correct answer is Na

Enter s to show a flashcard and q to quit: s

What is the symbol for Tin: Sn

Correct, well done!

Enter s to show a flashcard and q to quit: s

What is the symbol for Silver: Au

Sorry that is wrong. The correct answer is Ag

Enter s to show a flashcard and q to quit: s

What is the symbol for Antimony: Sb

Correct, well done!

Enter s to show a flashcard and q to quit: s

What is the symbol for Tungsten: W

Correct, well done!

Enter s to show a flashcard and q to quit: s

What is the symbol for Silver: Ag

Correct, well done!

Enter s to show a flashcard and q to quit: s

What is the symbol for Sodium: Na

Correct, well done!

Enter s to show a flashcard and q to quit: q

>>>

Box 2 – Keeping a notebook
In Part a (iv) we will be asking you to reflect briefly on your personal experiences as you tackled the modified flashcard problem. You will find this reflection much easier and more worthwhile if you keep some brief notes as you go along.

We suggest you record the following information:

How    A brief description of how you went about the task.
Resources    
Any documentation you consult (including course materials and any online sources) and which you found most useful.

Full references are not required: just note the source, and if you draw on the module materials record what part and section or activity you used.

Challenges    Anything you find challenging about the task, and how you deal with it.
Lessons learned    Anything you learn that you think would be useful if you faced a similar problem in the future.

 

1.Write an algorithm for the following section from Box 1, reproduced here for convenience.

2. Say 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.

Step by Step Solution

3.52 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

Solution Algorithm for the Flashcard Program from Box 1 Initialize a list of elements with unexpecte... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Programming questions

Question

If f '(x)

Answered: 1 week ago