Hello, this is my second ever attempt at writing a program. It is essentially a model of an economics paper I wrote. However, when I run it, after I enter the tax value it skips all the other inputs and then delivers an output.
What I am missing?
Code:
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// Enter the tax
int tax;
cout << "Enter the tax rate [0,1]: "
cin >> tax;
// Enter the gdp (millions)
int gdp;
cout << "Enter the gdp level (millions): "
cin >> gdp;
// Enter the population (millions)
int pop;
cout << "Enter the population (millions: ";
cin >> pop;
// Enter the inflation rate
int inflation;
cout << "Enter the inflation rate: ";
cin >> inflation;
// Enter the openness
int open;
cout << "Enter the openness rate [0,1]: ";
cin >> open;
int intercept;
intercept = 1.079;
// Calculate FDI
int fdi;
fdi = intercept + tax * 2.24 + gdp * 1.786 + pop * 0.002 + inflation * -0.048 + open * 0.029;
// Output the results (followed by NewLine)
cout << "Fdi is: ";
cout << fdi << endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;
}