Question: 1. Write a C++ program to assist a university administrator in determining some statistics about students. For each student, the administrator enters the student

1. Write a C++ program to assist a university administrator in determining

 

1. Write a C++ program to assist a university administrator in determining some statistics about students. For each student, the administrator enters the student number (5 digits), gender (1 for male and 2 for female), age, program of study. The administrator wants to determine the total number of students, the number of male students, the number of female students, etc. The administrator does not know in advance the number of students. Using your program, she or he should be able to indicate that all student information has been entered by entering the sentinel value -1 as the student number. The output of your program may look like this: Enter student number: 12345 Gender (1=male, 2= female): 1 Age: 18 Program of study: COEN Enter student number: 33345 Gender (1=male, 2= female): 2 Age: 20 Program of study: COEN Enter student number: 54345 Gender (1=male, 2= female): 2 Age: 18 Program of study: ELEC Enter student number: -1 Statistics: Total number of students is: 3 Number of male students is: 1 Number of female students is: 2 Average age of students is: 18 Number of COEN students: 2 Number of ELEC students is: 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!