Appendix 2
//Jennifer Gonzales
//Valerie Gonzales
//January, 2000
//Period 2
// Computer Challenge
//Libraries
#include <iostream.h> //allows the use of cin and cout
#include <math.h> //allows us to use math
int main()
{//open main
//declaring variables
double i,k,dd,od,r,s,v,ii,b,survivors;
//**********************************************************************
//k = constant population by the millions
k=1767000;
b= 0.0;
//**********************************************************************
for (int year=1; year<10; year++)
{
//At 20 years or younger you will become infected with one breath of the
//virus at the initial contact of the explosion.
//In NM 34% of people are under the age of 20.
//ii= the population of NM / the 34% of NM population under 20
//years of age
ii=k*.34;
//s = 2% of the susceptible that can contact the virus
//2% can still contact the virus
s=(k-ii)*.02;
//i= the total of infected people
i=k-ii;
i=ii+s;
s=k-i;
//**********************************************************************
//dd = death due to the diseases
//The death rate of the infected is 40%. We take NM population * .40
dd=i*.40;
// survivors= the infected * 60% which do not die
survivors= i*.60;
//**********************************************************************
//od = death due to other reason
//We took 1,767,000 and divided it by 100,000 because the death rates we
//calculated are by 100,000 people. After dividing it our answer is 17.67
//Then we took that percent and multiplied it by the death rate of each
//group age that is given
//Ages 1-4 is (34.2*17.67)=604.314
//Ages 5-14 is (19.7*17.67)=348.099
//Ages 15-24 is (81.2*17.67)=1,434.804
//Ages 25-44 is (155.2*17.67)=2,742.384
//Ages 45-64 is (660.5*17.67)=11,671.035
//Ages 65 & over is (5,111.8*17.67)=90,325.506
//Total death due to other causes = 107,126.142 or ~107,126
// percent found by total death/total population ==6%
od=k*.06;
//**********************************************************************
//r = recovery rate
// 2% per 100 people
//multiplied by .02 and this gives us the recovery rate.
r=.02*(k/100);
//**********************************************************************
//b = birth rate
//the birth rate for NM is 16/1000 people per year
b=(k/1000)*16.0;
//**********************************************************************
//Showing the output after all the variables have been entered
cout<< "The amount of people affected is"<<endl;
cout<<i<<endl;
//Showing the output of the people who are unable to contract the virus
cout<<"The amount of people susceptible is"<<endl;
cout<<s<<endl;
//**********************************************************************
//This formula calculates the new population
//The population minus all deaths plus the new births for each year
k=(k-(dd+od)+b);
cout<<"New Population"<<k<<endl;
cout<< i/k*100<<"% of population affected"<<endl;
} // end for loop
}//end program