Question: C + + Classes and vectors / classes . The program first reads integer townCount from input, representing the number of pairs of inputs to

C++ Classes and vectors/classes.The program first reads integer townCount from input, representing the number of pairs of inputs to be read. Each pair has a string and an integer, representing the towns name and population, respectively. One Town object is created for each pair and added to vector townList. Write the FindAverageTownPopulation() function in the SmallCities class to return the average population of all the Town objects as an integer.Example: If the input is: 3Worland 4503 Thayne 3800 Opal 2800then the output is: Average town population: 3701Note: The ArrayList has at least one element.

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!