Heres the Problem: Write a program to gauge the rate of inflation for the past year. The program asksfor 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. Your program should allow the user to repeat this calculation as often as the user wishes. Define a function to compute the rate of inflation. The inflation rate should be a value of type double giving the rate as a percentage, forexample 5.3 for 5.3%.
How can I check that the user makes sure to enter a double so when the user does enter a character, it says you've entered a invalid input. I have this so far but it doesn't work.