I am writing a program that is supposed to compare how old someone is in relation to recent events. I have gotten to the stage where I can put in some of the events but I am having some issues on how the formatting works. I studied this a few days ago but I cannot find my old resources on how to do it. Thank you in advance for helping.
//this code is for determining age relations to events in recent history
#include <iostream>
#include <string>
#include <cmath>
usingnamespace std;
int main()
{cout << "If you would like to use the program type in 1. If you do not type in 2" << endl;
int wwe;
cin >> wwe;
do {
cout << "What is your name?"<< endl;
string name;
cin >> name;
cout << "Okay " << name << ", how old are you in years?" << endl;
int x;
cin >> x;
cout << "What year is it now?";
int year;
cin >> year;
cout << "Do you want to compare your age to events in (A) the 2000s or (B) the 2010s? (Enter A or B)";
string e;
cin >> e;
if( e == "A" )
{
cout << "You sucessfully chose the 2000s." << endl;
int aa,bb,cc,dd,ee,ff,gg,hh,ii,jj;
year - 2000 = aa;
year - 2001 = bb;
year - 2002 = cc;
year - 2003 = dd;
year - 2004 = ee;
year - 2005 = ff;
year - 2006 = gg;
year - 2007 = hh;
year - 2008 = ii;
year - 2009 = jj;
}
elseif( e == "B" )
{
cout << "You sucessfully chose the 2010s." << endl;
}
else
{
cout << "That answer does not make sense, please try again." << endl;
;
}
}while (wwe==1);
}
//this code is for determining age relations to events in recent history
#include <iostream>
#include <string>
#include <cmath>
usingnamespace std;
int main()
{cout << "If you would like to use the program type in 1. If you do not type in 2" << endl;
int wwe;
cin >> wwe;
do {
cout << "What is your name?"<< endl;
string name;
cin >> name;
cout << "Okay " << name << ", how old are you in years?" << endl;
int x;
cin >> x;
cout << "What year is it now?";
int year;
cin >> year;
cout << "Do you want to compare your age to events in (A) the 2000s or (B) the 2010s? (Enter A or B)";
string e;
cin >> e;
if( e == "A" )
{
cout << "You sucessfully chose the 2000s." << endl;
int aa,bb,cc,dd,ee,ff,gg,hh,ii,jj;
year - 2000 = aa;
year - 2001 = bb;
year - 2002 = cc;
year - 2003 = dd;
year - 2004 = ee;
year - 2005 = ff;
year - 2006 = gg;
year - 2007 = hh;
year - 2008 = ii;
year - 2009 = jj;
}
elseif( e == "B" )
{
cout << "You sucessfully chose the 2010s." << endl;
}
else
{
cout << "That answer does not make sense, please try again." << endl;
;
}
}while (wwe==1);
}