Write a program to gauge the rate of inflation for the past year. The program asks for the price of an item (such as a hot dog or a 1-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 percent, for example 5.3 for 5.3 percent.

Your program must use a function to compute the rate of inflation. A program which does not use a function will be awarded a score of zero, even if all tests pass.

I want to repeat the loop, but no wonder I input Y or N, the loop will also repeat. Suppose the loop should repeat when I input 'Y' or 'y'. Can anyone tell me what's wrong with my code?

```
#include <iostream>
#include <cmath>
using namespace std;

double calculate_inflation(double, double);
int main()
{
   double yearAgo_price;
   double currentYear_price;
   double inflation_Rate;
   char again;

 do{
      cout << "Enter the item price one year ago (or zero to quit) : " << endl;
      cin >> yearAgo_price;

      cout << "Enter the item price today: " << endl;
      cin >> currentYear_price;

       cout.setf(ios::fixed)
       cout.setf(iOS::showpoint);
       cout.precision(2);

       inflation_rate=calculate_inflation(yearAgo_price, currentYear_price);
       cout << "The inflation rate is " << (inflation_rate*100) << " percent." << endl;

       cout << "Do you want to continue (Y/N)?" << endl;
       cin >> again;

      }while((again =='Y') || (again =='y'));

          return 0;
}

   double calculate_inflation (double yearAgo_price, double currentYear_price)
   {
      return ((currentYear_price-yearAgo_price)/ yearAgo_price);
   }

```