Question: Write a C++ program togaugethe rate of inflation for the past year. The program asks for the price of an item (such as a hot

Write a C++ program togaugethe rate of inflation for the past year. The program asks for the price of an item (such as a hot dog or a one-carat diamond) both one year ago and today. It estimates the inflation rate as the difference in price divided by the year-ago price.

Define a function to compute the rate of inflation (50 points). The inflation rate should be a value of type double, giving the rate as a percentage, for example 5.3 or 5.3%.

A sample dialog would be (you can make your own dialog prompts and response):

What is the cost of the item one year ago? 100.00 What is the cost of the item now? 103.50 The rate ofinflation for this item is 3.5%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!