Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Alabama,Southeast,4.7848,153.84,162.2283,485,98.285,11.019 Alaska,Far_West,0.7141,43.47,32.6496,68,22.956,6.327 Arizona,Southwest,6.4108,221.02,217.7587,763,135.599,16.944 Arkansas,Southeast,2.9228,92.08,93.6831,405,56.79,7.507 California,Far_West,37.3344,1672.5,1579.1,9235,1009.6,133.61 Colorado,Rocky_Mountain,5.0485,230.98,210.6077,868,141,16.786 Connecticut,New_England,3.5766,197.61,197.8393,717,121.063,15.102 Delaware,Mideast,0.8998,55.5,36.9576,249,25.364,3.07 D.O.C,Mideast,0.605,89.97,42.2093,833,75.886,3.668 Florida,Southeast,18.846,650.29,725.4363,2522,399.293,69.981 Georgia,Southeast,9.7147,358.84,333.6327,1215,227.035,25.884 Hawaii,Far_West,1.3643,59.67,56.8272,276,37.876,5.449 Idaho,Rocky_Mountain,1.5708,50.73,50.3852,337,29.356,3.309 Illinois,Great_Lakes,12.8405,571.23,540.2233,2746,362.936,50.556 Indiana,Great_Lakes,6.4899,241.93,223.1581,898,144.024,17.475 Iowa ,Plains,3.0503,124.01,119.0797,1039,72.04,9.097 Kansas,Plains,2.8588,113.32,110.8847,777,71.431,9.03 Kentucky,Southeast,4.3467,141.98,143.211,484,92.351,12.327 Louisiana,Southeast,4.5441,200.94,169.1167,759,105.141,14.309 Maine,New_England,1.3276,45.56,49.3602,175,29.505,4.539 Maryland,Mideast,5.788,264.32,289.6531,1128,175.607,18.693 Massachusetts,New_England,6.5633,340.16,337.9316,1564,229.298,20.998 Michigan,Great_Lakes,9.8777,329.81,346.8182,1159,215.579,29.912 Minnesota,Plains,5.3107,240.42,226.3199,1327,154.014,18.851

Alabama,Southeast,4.7848,153.84,162.2283,485,98.285,11.019 Alaska,Far_West,0.7141,43.47,32.6496,68,22.956,6.327 Arizona,Southwest,6.4108,221.02,217.7587,763,135.599,16.944 Arkansas,Southeast,2.9228,92.08,93.6831,405,56.79,7.507 California,Far_West,37.3344,1672.5,1579.1,9235,1009.6,133.61 Colorado,Rocky_Mountain,5.0485,230.98,210.6077,868,141,16.786 Connecticut,New_England,3.5766,197.61,197.8393,717,121.063,15.102 Delaware,Mideast,0.8998,55.5,36.9576,249,25.364,3.07 D.O.C,Mideast,0.605,89.97,42.2093,833,75.886,3.668 Florida,Southeast,18.846,650.29,725.4363,2522,399.293,69.981 Georgia,Southeast,9.7147,358.84,333.6327,1215,227.035,25.884 Hawaii,Far_West,1.3643,59.67,56.8272,276,37.876,5.449 Idaho,Rocky_Mountain,1.5708,50.73,50.3852,337,29.356,3.309 Illinois,Great_Lakes,12.8405,571.23,540.2233,2746,362.936,50.556 Indiana,Great_Lakes,6.4899,241.93,223.1581,898,144.024,17.475 Iowa ,Plains,3.0503,124.01,119.0797,1039,72.04,9.097 Kansas,Plains,2.8588,113.32,110.8847,777,71.431,9.03 Kentucky,Southeast,4.3467,141.98,143.211,484,92.351,12.327 Louisiana,Southeast,4.5441,200.94,169.1167,759,105.141,14.309 Maine,New_England,1.3276,45.56,49.3602,175,29.505,4.539 Maryland,Mideast,5.788,264.32,289.6531,1128,175.607,18.693 Massachusetts,New_England,6.5633,340.16,337.9316,1564,229.298,20.998 Michigan,Great_Lakes,9.8777,329.81,346.8182,1159,215.579,29.912 Minnesota,Plains,5.3107,240.42,226.3199,1327,154.014,18.851 Mississippi,Southeast,2.9691,85.36,91.5883,387,52.85,7.368 Missouri,Plains,5.9961,216.68,219.484,911,142.841,14.959 Montana,Rocky_Mountain,0.9907,31.92,34.2688,238,20.06,2.468 Nebraska,Plains,1.8297,80.64,73.0691,313,47.024,5.648 Nevada,Far_West,2.7038,109.61,99.2062,313,62.413,10.268 New_Hampshire,New_England,1.3168,55.24,59.1947,162,35.263,4.486 New_Mexico,Southwest,2.0648,70.79,68.4891,302,42.637,5.554 New_Jersey,Mideast,8.8034,431.41,449.0599,1733,267.585,42.41 New_York,Mideast,19.3992,1013.3,960.8265,6156,638.668,90.878 North_Carolina,Southeast,9.559,380.69,338.9875,1300,218.619,30.474 North_Dakota,Plains,0.6743,31.62,29.1538,603,18.645,2.366 Ohio,Great_Lakes,11.5383,413.99,418.5351,1608,272.716,33.551 Oklahoma,Southwest,3.7595,132.92,135.0626,448,80.058,9.231 Oregon,Far_West,3.8382,174.17,137.6717,703,88.9,8.032 Pennsylvania,Mideast,12.7113,493.53,529.8078,2125,323.795,39.317 Rhode_Island,New_England,1.0528,43.153,45.2676,200,27.112,3.971 South_Carolina,Southeast,4.6358,143.41,151.5368,472,93.025,11.875 South_Dakota,Plains,0.8162,34.37,33.1357,617,18.239,2.733 Tennessee,Southeast,6.3567,227.36,225.2247,730,138.683,19.039 Texas,Southwest,25.2427,1116.27,961.8281,2887,621.098,93.056 Utah,Rocky_Mountain,2.7751,105.2,90.1127,326,62.596,6.559 Vermont,New_England,0.626,23.34,25.1157,105,15.122,2.522 Virginia,Southeast,8.0251,377.47,359.9561,1113,248.951,28.016 Washington,Far_West,6.7436,307.69,286.7438,1526,187.423,28.482 West_Virginia,Southeast,1.854,53.58,58.9501,121,35.19,5.149 Wisconsin,Great_Lakes,5.6896,219.08,220.5023,973,141.446,18.435 Wyoming,Rocky_Mountain,0.5644,32,25.4336,82,15.684,3.662 New_York,Mideast,19.3992,1013.3,960.8265,6156,638.668,90.878 North_Carolina,Southeast,9.559,380.69,338.9875,1300,218.619,30.474 North_Dakota,Plains,0.6743,31.62,29.1538,603,18.645,2.366 Ohio,Great_Lakes,11.5383,413.99,418.5351,1608,272.716,33.551 Oklahoma,Southwest,3.7595,132.92,135.0626,448,80.058,9.231 Oregon,Far_West,3.8382,174.17,137.6717,703,88.9,8.032 Pennsylvania,Mideast,12.7113,493.53,529.8078,2125,323.795,39.317 Rhode_Island,New_England,1.0528,43.153,45.2676,200,27.112,3.971 South_Carolina,Southeast,4.6358,143.41,151.5368,472,93.025,11.875 South_Dakota,Plains,0.8162,34.37,33.1357,617,18.239,2.733 Tennessee,Southeast,6.3567,227.36,225.2247,730,138.683,19.039 Texas,Southwest,25.2427,1116.27,961.8281,2887,621.098,93.056 Utah,Rocky_Mountain,2.7751,105.2,90.1127,326,62.596,6.559 Vermont,New_England,0.626,23.34,25.1157,105,15.122,2.522 Virginia,Southeast,8.0251,377.47,359.9561,1113,248.951,28.016 Washington,FarWest,6.7436,307.69,286.7438,1526.187,423,28.482 West_Virginia,Southeast,1.854,53.58,58.9501,121,35.19,5.149 Wisconsin,GreatLakes,5.6896,219.08,220.5023,973,141.446,18.435 Wyoming,Rocky_Mountain,0.5644,32,25.4336,82.15,684,3.662

image text in transcribedimage text in transcribed Assignment Description You are to provide economic statistics by region as follows: - Total population for the region (sum of the column value) - Total GDP for the region (sum of the fourth column) - Average population in the region (total population / number of states in region) - Average personal income (Total of fifth column / total population) Your code must provide the following: - Prompt the user for a region name. - Read the data from the file selecting only the data for the region. - Build three dictionaries for the region for the population, GDP, and personal income. The key for each dictionary is the State. - In the case where the user entered an invalid region, an appropriate error message should be displayed. Note, you will not know this until you've read through the file and found no data. - Write a function called calc_total_pop is passed the population dictionary and returns the total population. You will obviously need to iterate through the dictionary to produce the total population. - Write a function called calc_total_gdp that is passed the gdp dictionary and returns the total GDP. - Write a function called calc_total_pi that is passed the personal income dictionary and returns the total personal income. The output of your must be as follows: - A list (not python list) of states in the region. - The Total population for the region. - The total GDP for the region. - The average population of the region. - The average personal income in the region. Include any appropriate captions and labels to describe the above date. Below is a suggest output format. Points will be deducted for an untidy report. Economic statistics for the Great_Lakes region: States in Region: Illinois, Indiana, Michigan, Ohio, Wisconsin Total population: 46.436 million Average population: 9.2872 million Total GDP: 1776.04 billion Average Pl: 37669.85 You may want to investigate the round function to reduce the number for decimals in floating point numbers. The join function will provide handy for showing all States on one line. Note since this is one problem in one notebook, use multiple cells to modularize your program. Assignment Background: The United States, home to approximately 320 million citizens, is a large country made of 50 states and the nation's capital, the District of Columbia (also called Washington D.C.). In this project, you will explore some of the economic statistics of each state and create some visualization of the data. No data on U.S. territories are included in the file. Data will be read from a CSV (comma-separated values) file called Economic_Data_2010.txt. This file has not header record, so you may read it as a plain text file and split the line to separate the individual values. Each row in the file contains the following information on each state in the United States from 2010. Values are separated by commas.: - 1st Value: State - 2nd Value: Region (defined by the Bureau of Economic Analysis) - 3rd Value: Population (in millions) o The total number of people living in the state. - 4th Value: GDP (in billions) o Measure of the state's economic activity, a higher GDP means higher monetary value for goods and services within the state's boarder. - 5th Value: Personal Income (in billions) o All incomes received by individuals and households. - 6th Value: Subsidies (in millions) o Money granted by the state's government to help an industry or business. - 7th Value: Compensation of Employees (in billions) o Pre-taxed wages paid by employers to employees. - 8th Value: Taxes on Production and Imports (in billions) o Taxes chargeable to business expenses of producing and importing Note that Python uses zero-based indexing, meaning that when data is put in a list the first value (State) will be found by taking the 0th index of the list. Also recognize that some values are in millions while others are in billions, so when using operations on two values (which you will) make sure to adjust them accordingly. The Bureau of Economic Analysis contains the following regions. This information is already in the provided data file. - Far_West: Alaska, California, Hawaii, Nevada, Oregon, Washington - Great_Lakes: Illinois, Indiana, Michigan, Ohio, Wisconsin - Mideast: Delaware, District of Columbia (Washington D.C.), Maryland, New_Jersey, New_York, Pennsylvania - New_England: Connecticut, Maine, Massachusetts, New_Hampshire, Rhode_Island, Vermont - Plains: lowa, Kansas, Minnesota, Missouri, Nebraska, North_Dakota, South_Dakota - Rocky_Mountain: Colorado, Idaho, Montana, Utah, Wyoming - Southeast: Alabama, Arkansas, Florida, Georgia, Kentucky, Louisiana, Mississippi, North_Carolina, South_Carolina, Tennessee, Virginia, West_Virginia - Southwest: Arizona, New_Mexico, Oklahoma, Texas This data is provided by the U.S. Bureau of Economic Analysis

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

Recommended Textbook for

Intermediate Accounting

Authors: Loren A. Nikolai, John D. Bazley, Jefferson P. Jones

11th edition

ISBN: 978-0538467087, 9781111781262, 538467088, 1111781265, 978-0324659139

More Books

Students also viewed these Accounting questions

Question

=+3. How active are the treasurer and the finance committee?

Answered: 1 week ago