#include #include #include #include #include #include #include #include #include using namespace std; main() { ostream& out = cout ; double productivityIncrease = .03 ; double demandFactor = .99 ; double jobChange = .25 ; // how much change in demand affects employment double employment = 1. -.076 ; static double initialEmployment = employment ; double wageElasticity = .25 ; // how much excess demand forces down wages double wageDemand = .5 ; int lastYear = 2140 ; double gdp = 1. ; double productivity = 1 ; double medianWage = 1. ; double initialWage = medianWage ; double demand = 1. ; double otherDemand = 1. - wageDemand ; int year = 2009; out << "Unemployment is a percentage of available workers.\n" ; out << "All other figures are percent change relative to year " << year -1 << endl ; out << " all but year are % change from " << year -1 << endl ; out << "year unemployment wages GDP productivity demand\n" ; out << "________________________________________________\n" ; double gdpDemandChange = 0 ; for (; year <= lastYear;year++) { productivity *= (1. + productivityIncrease) ; double prevGdp = gdp ; gdp = productivity * employment/initialEmployment; double gdpChange = gdp - prevGdp ; gdpDemandChange = gdpChange * demandFactor +gdpDemandChange ; demand = gdpDemandChange + otherDemand + wageDemand * employment*medianWage/(initialEmployment*initialWage); double demandDifference = gdp - demand ; employment *= (1. - demandDifference * jobChange) ; medianWage *= (1. - demandDifference * wageElasticity) ; out << year ; out.width(11) ; out << 100.*(1. - employment) ; out.width(11) ; out << 100 * (medianWage -1) ; out.width(11) ; out<< 100 * (gdp -1) ; out.width(11) ; out<< 100 * (productivity-1) ; out.width(11) ; out << 100 * (demand - 1.) ; out.width(11) ; out << 100 * (gdpDemandChange ) ; out << endl ; /* out << year << ", emp = " << employment << ", wages = " << medianWage << ", gdp = " << gdp << ", demand = " << demand << "\n" ; */ } }