STAGES OF LIFE You will develop a program to let the user to know important even
ID: 3905288 • Letter: S
Question
STAGES OF LIFE You will develop a program to let the user to know important events of life in a selected year. The stages are based on Erikson's Theory of Psychosocial Development. Your program must follow the format that is shown in the screen shots below. AGE 0 to 18 years 19 to 39 years 40 to 64 years 65 to death PSYCHOSOCIAL DEVELOPMENT STAGES Exploration &School; Social Relationships & Work Work & Parenthood Reflection on Life INPUTS Current year (See the screenshots below) INTEGER . The user's current age (See the screenshots below) INTEGER .Another year to calculate user age and find out the Important Events (See the screenshots below) OUTPUT: r year (See the screenshots below)I INTEGER Important Events in that year based on above given Erikson's Theory of Psychosocial Development stages (See the screenshots below)Explanation / Answer
here is your answer : -------------->>>>>>>>>>>>
#include<iostream>
using namespace std;
int main(){
int birthYear;
int currentYear;
int age;
int anotherYear;
int ageOnAnotherYear;
while(true){
cout<<" Enter Current Year : (INTEGER) ";
cin>>currentYear;
if(currentYear > 0){
break;
}
cout<<" No Negative year! ";
}
while(true){
cout<<" Enter Your Current Age : (INTEGER) ";
cin>>age;
if(age > 0){
birthYear = currentYear - age;
break;
}
cout<<" No Negative Age! ";
}
while(true){
cout<<" Enter Another Year : (INTEGER) ";
cin>>anotherYear;
if(anotherYear < birthYear){
cout<<" No Negative Age ! ";
}
else if(anotherYear > birthYear+95){
cout<<" No Ages More Than 95 !";
}else{
ageOnAnotherYear = anotherYear - birthYear;
break;
}
}
cout<<" Your Age On "<<anotherYear<<" is "<<ageOnAnotherYear<<" ";
if(ageOnAnotherYear <= 18){
cout<<" Event : Exploration & School ";
}else if(ageOnAnotherYear <= 39){
cout<<" Event : Social Relationship & Work ";
}else if(ageOnAnotherYear <= 64){
cout<<" Event : Work & Parenthood ";
}else{
cout<<" Event : Reflextion on Life ";
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.