PROJECT
The purpose of this project is to conduct an online survey and ask user to enter their names, ages, and genders. HOWEVER, to gather that information from user, we should first ask if they are willing to participate in the survey or not. If a user does not want to participate in the survey, then we SHOULD NOT ask any question to that user.
BEFORE WRITING THE ACTUAL PROGRAM
There are 2 classes that needs to be done to store data properly
QUESTIONS TO ASK IN PROGRAM
Would you like to join our survey? (Y/N)
If user enters Y, then ask below questions and store data but if user enters N, then do not ask those questions and go for another user.
What is your name?
How old are you?
What is your gender? (F/M)
NOTE: This program will end once you got 3 users to join to your survey. So, basically you will be gathering information from 3 users only.
EXPECTED OUTPUT
Print information for each participant
Print how many participants were male
Print how many participants were female
Print the age of youngest person
Print the age of eldest person
EXAMPLE PROGRAM:
Program: Would you like to join our survey? (Y/N)
User1: N
NOTE: So, user1 will not be asked any other questions as she/he refused to join to the survey!
Program: Would you like to join our survey? (Y/N)
User2: Y
Program: What is your name?
User2: Alex
Program: How old are you? User2: 25
Program: What is your gender? (F/M)
User2: M
Program: Would you like to join our survey? (Y/N)
User3: Y
Program: What is your name?
User3: Jennifer
Program: How old are you?
User3: 18
Program: What is your gender? (F/M)
User3: F
Program: Would you like to join our survey? (Y/N)
User4: N
NOTE: So, user4 will not be asked any other questions as she/he refused to join to the survey!
Program: Would you like to join our survey? (Y/N)
User5: Y
Program: What is your name?
User5: Jessica
Program: How old are you?
User5: 59
Program: What is your gender? (F/M)
User5: F
THE END RESULT OF ABOVE SURVEY
Participant {name: ‘Alex’, age: 25, gender: ‘M’}
Participant {name: ‘Jennifer’, age: 18, gender: ‘F’]
Participant {name: ‘Jessica’, age: 59, gender: ‘F’]
The total number of male participants is = 1
The total number of female participants is = 2
The age of the youngest person is = 18
The age of the eldest person is = 59