Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python code please Consumer Price Index: The consumer price index (CPI) indicates the average price of a fixed basket of goods and services. It is

python code please
image text in transcribed
Consumer Price Index: The consumer price index (CPI) indicates the average price of a fixed basket of goods and services. It is customarily taken as a measure of inflation and is frequently used to adjust pensions. The CPI was 9.9 in July 1913, was 100 in July 1983, and was 238.25 in July 2014. This means that $9.90 in July 1913 had the same purchasing power as $100.00 in July 1983, and the same purchasing power as $238.25 in July 2014 In 2009, the CPI fell for the first time since 1955. However, for most of the preceding 15 years it had grown at an average rate of 2.5% per year. Assuming that the CPI will rise at 2.5% per year in the future, how many years will it take for the CPI to double? Write a program that will ask the user for a starting year and the CPI for that year. Your program should print a table showing subsequent years and their CPIs. Note: Each year, the CPI will be 1.025 times the CPI for the previous year. Your table should include a heading at the top and tabs to separate columns. Each CPI should be displayed using 2 decimal places. The table should continue printing rows until the CPI has doubled the starting CPI. This program must use a while loop. The beginning of your table should look like this (the underlined items are just sample inputs): What is the year? 1983 what was the CPI that year? 238.25 CPT Year 1983 1984 1985 238.25 244.21 250.31

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago