Question: Write each line as part of a table, include a header before the table, and a summary line at the end. Use a fixed width
Write each line as part of a table, include a header before the table, and a summary line at the end. Use a fixed width for each column dont try to find the largest width like you did in the previous unit You should end up with something like
State Disease Number Year
COLORADO MEASLES
CONNECTICUT MEASLES
DELAWARE MEASLES
DELAWARE SMALLPOX
DISTRICT OF COLUMBIA SMALLPOX
FLORIDA SMALLPOX
Total
Not every field of the original line is used in the output. You will have to do some research about the format function to print the number of cases with a comma. If you cant get the comma in the number column, move on and come back to that once you have more of the program written. The key is to have all the columns line up
Use some if statements to add three filters to your program that let the user select exactly one state, disease and year to include in the report. Prompt the user to enter these values.
Enter state: Colorado
Enter disease: smallpox
Enter year:
State Disease Number Year
COLORADO SMALLPOX
Total
Unfortunately, this isnt very flexible.
Change your program so that if the user just hits return for a prompt, the program includes all the data for that field. For example:
Enter state Empty means all: Colorado
Enter disease Empty means all:
Enter year Empty means all:
State Disease Number Year
COLORADO MEASLES
COLORADO POLIO
COLORADO SMALLPOX
Total
Your program should run as expected using this small data set
Change the open statement in the program to use the full data set, healthnohead.csv
Write down the answers to the following queries:
How many cases of Hepatitis A were reported in Utah in
How many cases of polio have been reported in California?
How many cases of all diseases were reported in
Add another feature to your program.
This could be something like printing the highest and lowest numbers for each query, or allowing the user to just type the first part of value, so that entering for the year generates a table for years or entering D for a state gives information on Delaware and the District of Columbia. Or maybe leverage your previous assignment and make the column only as wide as they need to be for the data. Try to make it something useful.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
