Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question for Python. The Dictionary is a very powerful data structure. The objective of this programming assignment is to demonstrate proficiency with dictionaries. You are

Question for Python.

The Dictionary is a very powerful data structure. The objective of this programming assignment is to demonstrate proficiency with dictionaries. You are to write a program that manages a dictionary of Frequently Asked Questions (FAQ's). Questions serve as the keys and answers serve as the values. Your program will use a menu driven interface to display the items in the dictionary, add FAQ's and optionally to delete FAQ's.

Create a program with a menu that allows the user to do the following:

image text in transcribed

When displaying the FAQ's, neatly display the questions and answers paired together as in this example:

image text in transcribed

Requirements for Menu Selection 2:

  • If the question is already in the dictionary, do not overwrite it. Let the user know that the question is already in the FAQ's. Then ask the user to rephrase the question.
  • Otherwise, prompt the user for the answer
    • Add the question/answer pair to the dictionary using the question as the key and the answer as the value.

Requirements for Menu Selection 3 (optional):

Note that implementing menu selection 3 is for 10 points extra credit.

  • Ask the user for the question to be deleted.
  • Check to see if the question is in the dictionary.
  • If it isn't, let the user know that the question could not be found and that no changes were made.
  • Otherwise delete the item from the dictionary and let the user know that the item was deleted.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Students also viewed these Databases questions