Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Phase I: Write a program for a theater that will keep track of how many people i

ID: 3647113 • Letter: P

Question

Phase I: Write a program for a theater that will keep track of how many people in each of 5 age categories attended a particular movie. Use the 5 age categories listed below in the sample screen output. The user will enter a number of ages, entering a negative number when there are no more ages to enter. Your program will then report on how many people in each age group attended.


Phase II: Modify your program so that, in addition to the report that the program currently produces, it also gives the average age of the people in attendance, the age of the oldest person in attendance, and the age of the youngest person in attendance.


Phase III: Modify your program so that it also asks for the gender of each attendee. Your program should then break the attendance down by gender as well as by age.


sample output

Enter age of attendee: 1
Enter gender (M or F): F
Enter age of attendee: 2
Enter gender (M or F): F
Enter age of attendee : 3
Enter gender (M or F): F
Enter age of attendee: 4
Enter gender (M or F): F
Enter age of attendee : 5
Enter gender (M or F): M
Enter age of attendee : 6
Enter gender (M or F): M
Enter age of attendee : 8
Enter gender (M or F): M
Enter age of attendee : -1 [<---QUIT]

age 0 to 18: 7
age 19 to 30:
age 31 to 40:
age 41 to 60:
over 60:

males: 3
females: 4
The average age was 4 .
The youngest person in attendance was 1.
The oldest person in attendance was 8.

Explanation / Answer

#include #include #include using namespace std; int main () { int age; int sum; int average; double F, M; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote