The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
In your economics class, you are studying the purchasing power of money. Over time, the cost of items tends to go up (e.g., inflation), although sometimes prices may drop (e.g., deflation).
Use the Web to research price comparisons of items that are commonly purchased. For example, you may want to explore the US Census Bureau’s 2012 Statistical Abstract site (http://www.census.gov/compendia/statab/) to locate current and past price indexes on food, fuel, or housing.
Write a program that inputs an item’s description, a past year, a past price, a current year, and a current price. Make sure your program can handle multi-word descriptions.
The program should then calculate the percent change between the past and current prices and display a report. Your report should have the following characteristics:
 • All prices must be formatted to display two decimal places.
 • Percent change must be formatted to display one decimal place.
 • All report labels must be left aligned, and all report values must be right aligned.
 • The report must contain a heading that includes the years being compared
Sample output:
Enter description: Potato Chips
Past Year: 2000
Past Year Price: 3.44
Current Year: 2010
Current Year Price: 4.74
 Price Comparison: 2000 to 2010
 Item: Potato Chips
 Past Year: 2000
 Past Year Price: 3.44
 Current Year: 2010
 Current Year Price: 4.74
 Percent change: 37.8%
-----------