Question: USING C++: Consider the following structure struct Person { string first_name; string last_name; int age; }; Given an array of type Person of size n,

USING C++:

Consider the following structure

struct Person { string first_name; string last_name; int age; };

Given an array of type Person of size n, write a function that will return the last_name that is most represented in the array. The function prototype is provided below.

E.g. if A={{"Monty", "Burns", 80}, {"Homer", "Simpson", 55}, {"Moe", "Szyslak", 57},{"Marge", "Simpson", 52}, {"Bart", "Simpson", 10}} then mostFrequentLastName(A,5) will return "Simpson".
string mostFrequentLastName(Person A[], int n); 

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!