Question: C++ Help. Please COMMENT. PLEASE FOLLOW DIRECTIONS. Sorting Youngest to Oldest Implement a class Person with the following data members: name (string) - name of

C++ Help. Please COMMENT. PLEASE FOLLOW DIRECTIONS.

Sorting Youngest to Oldest Implement a class Person with the following data members: name (string) - name of this person age (integer) age of this person Write a program that reads in a list of names and ages and stores them in a one-dimensional array of Person objects. The maximum number of names that will be entered is 100 names. After reading in the list of names and ages, sort the list of people from the youngest (lowest age) to oldest (highest age) using the Bubble Sort. Then print out the name and age for each person in the sorted list.

Sample Output :

Enter name (-1 to stop): Bart

Enter age of Bart: 10

Enter name (-1 to stop):

Lisa Enter age of Lisa: 8

Enter name (-1 to stop): Maggie

Enter age of Maggie: 1

Enter name (-1 to stop): Homer

Enter age of Homer: 36

Enter name (-1 to stop): Marge

Enter age of Marge: 34

Enter name (-1 to stop): -1

Name: Maggie, age: 1

Name: Lisa, age: 8

Name: Bart, age: 10

Name: Marge, age: 34

Name: Homer, age: 3

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 Databases Questions!