Question: #include #include using namespace std; class Person { private: unsigned age; string ssn; string name; public: Person(unsigned age, string ssn, string name); ~Person(); friend ostream&

#include #include using namespace std;

class Person { private: unsigned age; string ssn; string name; public: Person(unsigned age, string ssn, string name); ~Person(); friend ostream& operator

Person::Person(unsigned age, string ssn, string name) { this->age = age; this->ssn = ssn; this->name = name; } Person::~Person() { // cout

// Function to print whole map void printMap(map* bankAccountMap) { for(map::iterator iter = (*bankAccountMap).begin(); iter != (*bankAccountMap).end(); ++iter) { coutfirstsecond

int main(int argc, char ** argv) { // Initialize map map bankAccountMap;

// Create person objects Person person1(34,"123-45-6780","Jon"); Person person2(35,"123-45-6781","Brendan"); Person person3(36,"123-45-6782","David"); Person person4(37,"123-45-6783","Alex"); Person person5(38,"123-45-6784","Anwar"); Person person6(39,"123-45-6785","Max"); Person person7(40,"123-45-6786","Ian"); Person person8(40,"123-45-6787","Gabriella"); Person person9(40,"123-45-6788","Sarah"); Person person10(40,"123-45-6789","Austin");

// Insert person objects in map bankAccountMap.insert(pair(1230, person1)); bankAccountMap.insert(pair(1231, person2)); bankAccountMap.insert(pair(1232, person3)); bankAccountMap.insert(pair(1233, person4)); bankAccountMap.insert(pair(1234, person5)); bankAccountMap.insert(pair(1235, person6)); bankAccountMap.insert(pair(1236, person7)); bankAccountMap.insert(pair(1237, person8)); bankAccountMap.insert(pair(1238, person9)); bankAccountMap.insert(pair(1239, person10));

// Print size of map cout

// Iterage and print map cout

// Delete one person entry (delete person4) bankAccountMap.erase(1233);

// Iterage and print map cout

// Delete last entry bankAccountMap.erase(1239);

// Iterage and print map cout

return 0; } I need the code above to be split up into 3 different files. I'm using MobaXterm and I need the code to be split into a: personClass.h file personClass.cpp file bankAccountMap.cpp file. I tried to split the code up myself, but received errors in multiple places when I did. These are the errors I kept seeing.#include #include using namespace std; class Person { private: unsigned age; string but The The code itself works exactly the way it should, but it needs to be in 3 separate files, like this.ssn; string name; public: Person(unsigned age, string ssn, string name); ~Person(); friend

bankAccountMap.cpp: 66:1: error: expected ' at end of input bankAccountMap.cpp:66:1: error: expected unqualified-id at end of input personClass.cpp : 7:1: error: extra qualification 'person ::, on member person ' [.fpermissive] person: :person (unsigned age, string ssn, string name) personCLass.cpp : 7 : 1: error: person: :person (unsigned int, std::-c xx11:string, std ::-c xx11:string), cannot be overloaded In file included from personClass.cpp:4:0: personClass.h:27:3: error: with 'person: :person (unsigned int, std::_cxxll::string, std::_cxxl1::string) person (unsigned age, string ssn, string name) personClass.cpp:18:54 : error: std: :ostream& person: :operator

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!