Question
This code is being done on python Please I need help with the following problems: 1)I keep getting this error when I select any of
This code is being done on python
Please I need help with the following problems:
1)I keep getting this error when I select any of the options:
Traceback (most recent call last):
File "C:\Users\guest pc\PycharmProjects\pythonProject3\main.py", line 133, in
display_sorted_states ()
File "C:\Users\guest pc\PycharmProjects\pythonProject3\main.py", line 80, in display_sorted_states
print ( state[i][0], "\t\t", state[i][1], "\t\t", state[i][2], "\t\t", state[i][3] )
IndexError: list index out of range
2)Also having problems with these functions:
3. Provide a Bar graph of the top 5 populated States showing their overall population. <-- not getting a graph bar
4. Update the overall state population for a specific state
These were the instructions i was given:
Need help producing a command line menu-driven python application providing users with the ability to search and display U.S. State Capital, population and Flowers. The second part documents your testing and pylint analysis results.
1. (80 points) Python command line menu-driven application that allows a user to display, sort and update, as needed a List of U.S states containing the state capital, overall state population, and state flower. The Internet provides multiple references with these lists. For example:
You will need to embed the State data into your Python code in a data structure of your choice, from the readings this week. The user interface will allow the user to perform the following functions:
1. Display all U.S. States in Alphabetical order along with the Capital, State Population, and Flower
2. Search for a specific state and display the appropriate Capital name, State Population, and an image of the associated State Flower.
3. Provide a Bar graph of the top 5 populated States showing their overall population.
4. Update the overall state population for a specific state.
5. Exit the program
As before, generate an appropriate Welcome, prompt, and exit messages to help the user navigate the program.
The program should continue to allow selections until the program is exited
If a state is not found an appropriate message should be displayed. Hints:
1. Use the List data structure and associated sort() and searching capabilities
2. Make and use functions as often as possible.
3. Validate input data to ensure each entry from the user is correct before proceeding.
4. Prompt the user to reenter information as needed.
6. Use comments to document your code
7. Test with many combinations.
8. Use pylint to verify the code style - the goal is a 10!
9. Before you import a third part library (e.g. matplotlib) )you must install it. To install a Third Party library, you use this command at the command prompt:
python -m pip install -U matplotlib
2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test.
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