Create ONLY PSEUDOCODE AND FLOWCHART FOR THE PROGRAM BELOW IN C++ (I have already written the program) that simulates a simple contact manager application given the following requirements:
The program is to store individual names and associated telephone numbers in parallel arrays.
The program should input from the user 10 people’s names and their telephone numbers and add the data to the parallel arrays.
When data input is finished, the program should sort both data arrays in ascending order based on telephone numbers maintaining the associations between names and telephone numbers.
The program will print the list of users and their telephone numbers after sorting.
After printing the list, the program will ask for a name to search for. The user will then enter a name.
The program will then search for the name and print the name and the associated telephone number for that person.
If the person is not in the array, the program will print that the user cannot be found.
The program must use at least one menu at the beginning with multiple options including an option to exit the program. The program must run continuously, in a cyclic manner until the user chooses to exit. Sublevel menus are allowed. The program must use: multiple data types, multiple mathematical operators, decision structures, iterative structures, and functions.
#include <iostream>
#include <string>
#include <iomanip> // std::setprecision
using namespace std;
// Declaring Global Arrays
string names[10];
long long phoneNos[10];
// Function Declarations
void getData();
void sort();
void display();
long long searchPhoneNum();
int main()
{
// Declaring variables
int choice;
/* This while loop continues to execute
* until the user enters a valid number
*/
while (true)
{
cout << “:: Menu ::” << endl;
cout << “1.Store Data.” << endl;
cout << “2.Sort.” << endl;
cout << “3.Search Phone Number.” << endl;
cout << “4.Exit.” << endl;
cout << “Enter Choice :”;
cin >> choice;
/* Based on the user’s choice
* the corresponding case will be executed
*/
switch (choice)
{
case 1:
{
// Calling the functions
getData();
continue;
}
case 2:
{
// Calling the functions
sort();
display();
continue;
}
case 3:
{
// Calling the functions
long long no = searchPhoneNum();
if (no != -1)
cout << “The Telephone number is :” << no << endl;
else
cout << “** Name not found **” << endl;
continue;
}
case 4:
{
cout << “** Program Exit **” << endl;
break;
}
default:
{
cout << “** Invalid Input **” << endl;
continue;
}
}
break;
}
return 0;
}
/* Function implementation which will
* get the data from the user and populate
* the data into arrays.
*/
void getData()
{
string name;
long long phNo;
for (int i = 0; i < 10; i++)
{
cin.ignore();
cout << “Enter name of Person # ” << i + 1 << “:”;
std::getline(std::cin, name);
names[i] = name;
cout << “Enter Phone Number:”;
cin >> phNo;
phoneNos[i] = phNo;
}
}
/* Function implementation which will
* which will sort the data in the arrays.
*/
void sort()
{
// This Logic will Sort the Array of elements in Ascending order
string tempName;
long long tempNum;
for (int i = 0; i < 10; i++)
{
for (int j = i + 1; j < 10; j++)
{
if (phoneNos[i] > phoneNos[j])
{
tempNum = phoneNos[i];
phoneNos[i] = phoneNos[j];
phoneNos[j] = tempNum;
tempName = names[i];
names[i] = names[j];
names[j] = tempName;
}
}
}
}
/* Function implementation which will
* search the phone number in the arrays.
*/
long long searchPhoneNum()
{
string name;
cin.ignore();
cout << “Enter the name :”;
std::getline(std::cin, name);
int i = 0;
while (i < 10)
{
if (name.compare(names[i]) == 0)
{
return phoneNos[i];
}
i++;
}
return -1;
}
/* Function implementation which will
* display the data in the arrays.
*/
void display()
{
cout << “nDisplaying Names and Phone Numbers After sorting ” << endl;
for (int i = 0; i < 10; i++)
{
cout << setw(10) << names[i] << “tt” << phoneNos[i] << endl;
}