#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void getInput (double& currentPrice, double& prevYrPrice, double& twoYrAgoPrice);
void calculateInflation (double currentPrice, double prevYrPrice,
double twoYrAgoPrice, double & currentInflation,double & preInflation);
void printOutput (double currentInflation, double prevInflation);
int maine ()
void getInput (double& currentPrice, double& prevYrPrice, double& twoYrAgoPrice);
{
cout << "Enter the current Price:";
cin >> currentPrice;
cout << Endl;
cout << "Enter the previous year Price:";
cin >> prevYrPrice;
cout << endl;
cout << "Enter the Price two years ago:";
cin >> twoYrAgoPrice;
cout << endl;
}
void calculateInflation (double currentPrice, double prevYrPrice,
double twoYrAgoPrice, double & currentInflation,double & preInflation);
{
currentInflation = (currentPrice - prevYrPrice)/ prevYrPrice;
prevInflation = (prevYrPrice - twoYrAgoPrice) / twoYrAgoPrice;
}
void printOutput (double currentInflation, double prevInflation);
{
cout << Inflation of This Year is:<<
(currentInflation * 100) << "%" << endl;
cout << Inflation of previous year is: <<
(prevInflaton * 100) << "%"<< endl;
if (prevInflation < currentInflation)
cout << "inflation is increasing" << endl;
else if ( prevInflation == currentInflation)
cout << "Inflation from the past two years is the same" << endl;
}
int main ()
{
**** double currentPrice, prevYrPrice, twoYrAgoPrice;
double currentInflation, prevInflation;
getInput (currentPrice, prevYrPrice, twoYrAgoPrice);
calculateInflation (currentPrice, prevYrPrice, twoYrAgoPrice,
currentInflation,prevInflation);
printOutput (currentInflation, prevInflation);
system "pause";
#
**`