#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";

#
**`

Recommended Answers

All 2 Replies

could you repost the whole code
...why is there an int maine() on line 14?

also post the complete error message -- it tells you what function(s) is/are missing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.