Modify the Vector on the shown example  below  by creating a Person Class, an Em

Modify the Vector on the shown example  below  by creating a Person Class, an Employer Class and a Personal Info Class. Use the Employer and PersonalInfo classes as member variables of a Person class. Modify the Vector class to hold People objects instead of Record objects. Modify the menu interface and input algorithms to accept data for the Employer and Personal Info classes via functions in the Person class. Modify the Output to print all the information in each Person object, associated Employer object, and associated Personal Info object. Make sure to separate the implementation of your classes from the header files. You should have a .cpp file and a .h file for each class you create.
HEADER.h
#include
#include
#include
using namespace std;
class Record
{
private:
int age;
long long int phone;
int record;
string first, last;
public:
Record();
Record(int, string, string, int, int);
void display();
void setData(int, string, string, int, int);
};
Record::Record()
{
record = 0;
age = 0;
phone = 0;
}
Record::Record(int rec, string first, string last, int ag, int phone)
{
record = rec;
first= first;
last = last;
age = ag;
phone= phone;
}
void Record::setData(int rec, string first, string last, int ag, int phone)
{
record = rec;
first = first;
last = last;
age = ag;
phoner = phone;
}
void Record::display()
{
cout << "n-------------------- Contact Information -------------------- n"; cout << "Record number: " << record << endl; cout << "First name: " << first << endl; cout << "Last name: " << last << endl; cout << "Age: " << age << endl; cout << "Phone number: " << phone << endl; } void menu() { cout << "n------------------------ Selection Menu ----------------------- n"; cout << " enter 1 to add contact" << endl; cout << " enter 2 to display contacts" << endl; cout << " enter 3 to end program" << endl; } VECTOR.cpp #include
#include
#include “Header.h”
int main()
{
int count = 0;
int record, age, choice;
long long int phone;
string first, last;
int size = 10;
// vector is used instead of the array
vector rec(10);
cout << " -------------| Vector |-------------n"; while (1) { menu(); cout << " input option: "; cin >> choice;
if (choice == 1)
{
if (count ==1000)
{
cout << " The contacts are full" << endl; } else { //if choice to enter contact, gather information cout << " enter record number: "; cin >> record;
cout << " enter contact first name: "; cin.ignore(); getline(cin, first); cout << " enter contact last name: "; getline(cin, last); cout << "enter contact age: "; cin >> age;
cout << "enter contact phone number: "; cin >> phone;
rec[count].setData(record, first, last, age, phone);
count++;
}
}
else if (choice == 2)
{
//if choice 2 is used show records
if (count == 0)
{
cout << "No contacts" << endl; } else { for (int i = 0; i < count; i++) { rec[i].display(); } } } else if (choice == 3) { return 0; } else { //when wrong option is entered show cout << "enter option from 1 to 3" << endl; } } return 0; }

Posted in Uncategorized

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount