You have been tasked to implement a program that manipulates a list of clients’ information. The client information consists of client’s phone number, first name, last name, and age. The list is not sorted in any particular order. Furthermore, you are given the entire list stored into a single string. This primitive way of storing such information is limiting. Hence, you should parse the string and harvest all its content into proper containers and data types. A series of functions must be implemented as follows
A function that parses clients data into proper data containers (20 marks)
A function that finds the yougest client (10 marks)
A function that sorts the clients by first name (10 marks)
A function that prints out the sorted client list (10 marks)
A function that computes the average age of the clients (10 marks)
The output of your program should be identical to the screenshot shown below. In the next page, you will find code snippets that can be copied into your program to save you the time of having to enter the client list manually. Please add your functions to the existing code, and DONOT change the provided function getClientDatabase() in any way or form. Also you should not call getClientDatabase() or parse the client list more than once.
#include <iostream>
#include <string>
using namespace std;
string getClientDatabase();
int main()
{
string data = getClientDatabase();
// TODO:
// Implement a function that parses clients data into proper containers
// Implement a function that finds the youngest client
// Implement a function that sorts the clients by first name
// Implement a function that prints out the sorted client list
// call these functions in main following the same mentioning order
return 0;
}
string getClientDatabase()
{
return
"(844)615-4504 Sofia Ross 57 \n"
"(822)516-8895 Jenna Doh 30 \n"
"(822)896-5453 Emily Saks 43 \n"
"(844)307-0763 Kerli Wilson 27 \n"
"(844)897-3011 Gemma Jaywald 38 \n"
"(833)384-2890 Emma Genkins 21 \n"
"(822)962-3158 Samantha Kenwald 34 \n"
"(833)655-3197 Madison Kemeco 57 \n"
"(811)843-8654 Jane Smith 57 \n"
"(899)482-2829 Kerry Lee 28 \n"
"(822)921-0896 Kathy Lesly 59 \n"
"(844)417-6046 Jason Daniels 59 \n"
"(811)908-6536 Kenny Wald 56 \n"
"(811)292-1219 Jenny Stone 23 \n"
"(855)302-1086 Michelle Han 42 \n"
"(833)031-1871 Grace Genny 21 \n"
"(822)704-3313 Rachel McCarthy 46 \n"
"(833)157-3665 Kathleen Kelly 41 \n"
"(899)782-8783 Katie Norton 53 \n"
"(822)248-0208 Sherline Joans 21 \n"
"(899)024-3379 Kathy Jonas 47 \n"
"(844)278-9440 Hannah Stuert 33 \n"
"(855)320-0148 Penny Marino 29 \n"
"(855)973-1712 Lisa Hanson 57 \n"
"(822)471-8413 Yvette Longoria 31 \n"
"(822)826-2765 Rose Jenings 38 \n"
"(899)950-0083 Kathrine Hinds 39 \n"
"(811)571-3930 Ima Jones 50 \n"
"(844)112-5253 Josh Hart 41 \n"
"(899)704-4794 Kamine Herfer 25 \n";
}