Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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.image text in transcribed but The The code itself works exactly the way it should, but it needs to be in 3 separate files, like this.image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions

Question

Q: How much does Alpha-Gamma invest in training?

Answered: 1 week ago

Question

Determine the roles of spatial layout and functionality.

Answered: 1 week ago