#include <iostream>
usingnamespace std;
int message();
int main(){
// Creating a Sentinel Application - not knowing the amount of loops \
such as Age, Weights and using -1 to quit.
message();
return 0;
}
int message(){
int age;
int total = 0;
int counter = 0;
int average = 0;
cout << "Enter your age or -1 to quit: ";
cin >> age;
while(age != -1){
cout << "Enter your age or -1 to quit: ";
cin >> age;
total += age;
counter++;
average = (total / counter);
}
cout << "\n The total of people entered is " << counter << " people and their average is " << average << "." << endl;
return average;
}