IDNLearn.com provides a comprehensive platform for finding accurate answers. Our platform is designed to provide quick and accurate answers to any questions you may have.
PYTHON!!!!
Write a program that starts off with a predefined set of States and their Capitals entered into a
dictionary as key-value pairs (see below for startup pre-entered data). The program should
display a menu and not exit the program/menu until the user selects the option from the menu to
exit.
The program should have listed on the 'main' menu the following commands:
* Menu must be presented in the same order as the following
1) Display all the States and their Capitals stored in the dictionary (sorted ascending by State)
a.
Should be in a list/table style with the heading/banner format
2) Display all the Capitals in the dictionary (sorted ascending)
Capitals only
Should be in a list/table with the heading/banner format
3) Display all the States in the dictionary (sorted ascending)
a.
States only
i.
Should be in a list/table with the heading/banner format
4) Display how many States/Capital pairs exists in the dictionary
a.
Displayed in a complete sentence format using variable in the sentence
5) Look up a specific State in the dictionary
a.
Displayed in a complete sentence format using the searched for (State Name)
b. If not found display "(State Name) not found'
6) Look up a specific Capital in the dictionary
a. Displayed in a complete sentence format using the searched for (Capital Name)
b.
If not found display *(Capital Name) not found'
7) Divide the Capitals A-M then M-Z
a.
Display all the Capitals from A-M
i
Should be in a list/table with the heading/banner format
b. Display all the Capitals from N-Z
i. Should be in a list/table with the heading/banner format
8) Divide the States A-M then M-Z
a. Display all the States from A-M
i
• Should be in a list/table with the heading/banner format
b. Display all the States from N-Z
. Should be in a list/table with the heading/banner format
9) Add a State and its Capital to the dictionary
a.
Confirm/cancel user's selection prior to addition of State and Capital
b.
Confirm in a complete sentence format the State and Capital was added
C.
Then Display all the States and Capitals in the Dictionary (just like #1)
10) Remove a State and its Capital from the dictionary
a.
Confirm/cancel user's selection prior to removing the of State Capital
b. Confirm in a complete sentence format the (State name) and (Capital name) was
removed from the dictionary
C.
Then Display all the States and Capitals in the Dictionary (just like #1)
11) Change a State's Capital
a.
Confirm/cancel user's selection prior to changing the of State's Capital
b. Confirm in a complete sentence format the (State name) and (original Capital) was
changed to the (new Capital name).
c. Then Display all the States and Capitals in the Dictionary (just like #1)
12) Remove all States and Capitals from the States options
a.
Confirm/cancel user's selection prior to removing all the of States and Capitals
b. Confirm in a complete sentence format that all the States and Capitals was
removed from the dictionary
C. Then Display all the States and Capitals in the Dictionary just like #1)
13) Exit the program menu
1. Should be a blank list/table with the heading/banner only being displayed
a. (* do not use 'break' or 'sys.exit')
The following States (10) should be loaded in the program upon the startup of the program:
New Mexico - Santa Fe
Colorado - Denver
Nebraska - Lincoln
Wisconsin - Madison
Iowa - Des Monies
Main - Augusta
Hawaii - Honolulu
Tennessee - Nashville
Minnesota - Saint Paul
Ohio - Columbus
Sagot :
Your presence in our community is highly appreciated. Keep sharing your insights and solutions. Together, we can build a rich and valuable knowledge resource for everyone. Find clear and concise answers at IDNLearn.com. Thanks for stopping by, and come back for more dependable solutions.