Menu

[Solved]Cr App Represent Form Classes Various Company Project Asked Design Implement Following Cla Q37220712

a Cr+ app to represent in the form of classes various company. In this project, you are asked to design and implement the folFor instance, a call such as agentclientRelation1.findclientlocation(c200) should return a pointer to the client whose nameMethods e-Agent b Agent public public string Fields string Client Methods Client string public Fields Name string private Outclass Client private: string cName; public: Client(string value) cName value;) -Client() { cout << Client destroyed 《く thisMain App // Homework3.cpp #include #include #include #include #include pch.h <iostream» Agent,h Clienth AgentClientRea Cr+ app to represent in the form of classes various company. In this project, you are asked to design and implement the following classes Agent (string agentId, string name, string phone, string homeAddress) Client (string agentld, string name, string phone, string homeAddress) AgentClientRelationship (Agent *agentPointer, vectorcciient> vclient) The Agent and Client classes represent persons playing the roles of insurance representative and customers respectively. The AgentClientRelationship is a 1-to-many relationship connecting one agent with multiple insured clients. The figure below depicts a possible state of the app. Observe that the agent Ben Franklin is connected to two customers that are known as Happy ClientI and Happy Client2 elient Clienta cid tc00 Figure 1. An instance o the Agent-Client Relationship showing two dlients connected to an agent. A skeleton app is provided at the end of this assignment, and it could be used to get you started. However notice that it contains much less elements than what the project is requesting Make sure to use the inline-class definition style. Try to apply best practices such as code reuse, and constructors using default arguments. Delete each dynamically created object (do that in the appropriate destructor). Test your program using data items that closely reproduce the data state shown in Figurel Write an AgentClientRelationship public member function that takes for input a dlient id and returns pointer to the requested object (or nu11ptr when the client is not found). The signature of the search function follows Client findCliendLocation(string clientId) For instance, a call such as agentclientRelation1.findclientlocation(“c200”) should return a pointer to the client whose name is “Happy Client2”. Test your member function using the client key values “c200″ and 500″ (see Figurel). Submit your report electronically as a pdf file using Canvas. The report must include the main function, each class (header file only), the class diagram generated by Visual-Studio, and a snapshot of your output screen showing the contents of the Agent-Client association (see Figurel) as well as the results produced by the search method. DEMO: Skeleton Version of the Agent-Client Case Client Fields a Methods e Methods -Clent objString e obi5tring · Fields vclient Methods -AgentCentRlaionship Methods void publk string Fields Agent dient Agent Methods e-Agent b Agent public public string Fields string Client Methods Client string public Fields Name string private Output c1 Client[ Name: Happy Clientl, this: 6eFBF828 c2 Clientl Name: Happy Client2, this: e0FBF804 c3 Client[ Name: Happy Client3, this: 0eFBF7E0 ac1 AgentClientRel [ Agent:00FBF84C, Clients: [eoFBF828, e0FBF884, 0eFBF7Ee, 1, this:8eFBF7C41 All done! AgentClientRel destroyed 00FBF7C4 lient destroyedeeFBF7Ee Client destroyed geeFBF884 lient destroyed ooFBF 828 Agent destroyed eeFBF84C Agent Class (Skeleton) class Agent private: string agName; public: Agent (string value) agName value; Agent) cout<< Agent destroyed<this <endl;) string objstring(string msg·.”) { stringstream sout; sout << msgAgent[ Name:<agName <<“,this: “<this << return sout.strO Client Class (Skeleton) class Client private: string cName; public: Client(string value) cName value;) -Client() { cout << ” Client destroyed 《く this << endl; } string objstring(string msg . ..) { stringstream sout; sout << nsg << . Client[ Name: << cName << “, this: ” << this 《《 ]”; return sout.strO: )i class AgentClientRelationship private: Agent “agentPtr vector<Client«, vclient; public: AgentClientRelationship(Agent *agentPtr·nullptr) this->agentPtr . agentPtr; -AgentClientRelationshipO ( cout <AgentC1ientRel destroyed this << endl; void addclient(Client clientPtr) vclient.push back(clientPtr); string objstring(string msg . ..) { ostringstream clist for (int í ·0; ǐ < vclient-size(); İ++) { clist < vclient.at(i) stringstream sout; sout くくmsg AgentClientRel [ Agent: < agentPtr << -, Clients: [. << CList .str() << -], this.” << this return sout.str); Main App // Homework3.cpp #include #include #include #include #include “pch.h” <iostream» “Agent,h” “Client”h” “AgentClientRelationship.h” int main Agent al(“Ben Franklin”): cout << a1.objString(” al”)<endl; Client c1(“Happy Client1″ cout << c1.objString c1”) <<endl; Client c2( “Happy Client2″ cout << c2.objString C2”) <<endl; Client c3(“Happy Client3″); cout << c3.objString(” c3″) <endl; AgentClientRelationship ac1 (8a1) ac1.addClient (&c1); ac1.addClient (&c2); acl.addClient (&C3); cout << ac1.objString(” acl”) << endl; cout << n All done!n” Show transcribed image text a Cr+ app to represent in the form of classes various company. In this project, you are asked to design and implement the following classes Agent (string agentId, string name, string phone, string homeAddress) Client (string agentld, string name, string phone, string homeAddress) AgentClientRelationship (Agent *agentPointer, vectorcciient> vclient) The Agent and Client classes represent persons playing the roles of insurance representative and customers respectively. The AgentClientRelationship is a 1-to-many relationship connecting one agent with multiple insured clients. The figure below depicts a possible state of the app. Observe that the agent Ben Franklin is connected to two customers that are known as Happy ClientI and Happy Client2 elient Clienta cid tc00 Figure 1. An instance o the Agent-Client Relationship showing two dlients connected to an agent. A skeleton app is provided at the end of this assignment, and it could be used to get you started. However notice that it contains much less elements than what the project is requesting Make sure to use the inline-class definition style. Try to apply best practices such as code reuse, and constructors using default arguments. Delete each dynamically created object (do that in the appropriate destructor). Test your program using data items that closely reproduce the data state shown in Figurel Write an AgentClientRelationship public member function that takes for input a dlient id and returns pointer to the requested object (or nu11ptr when the client is not found). The signature of the search function follows Client findCliendLocation(string clientId)
For instance, a call such as agentclientRelation1.findclientlocation(“c200”) should return a pointer to the client whose name is “Happy Client2”. Test your member function using the client key values “c200″ and 500” (see Figurel). Submit your report electronically as a pdf file using Canvas. The report must include the main function, each class (header file only), the class diagram generated by Visual-Studio, and a snapshot of your output screen showing the contents of the Agent-Client association (see Figurel) as well as the results produced by the search method. DEMO: Skeleton Version of the Agent-Client Case Client Fields a Methods e Methods -Clent objString e obi5tring · Fields vclient Methods -AgentCentRlaionship Methods void publk string Fields Agent dient Agent
Methods e-Agent b Agent public public string Fields string Client Methods Client string public Fields Name string private Output c1 Client[ Name: Happy Clientl, this: 6eFBF828 c2 Clientl Name: Happy Client2, this: e0FBF804 c3 Client[ Name: Happy Client3, this: 0eFBF7E0 ac1 AgentClientRel [ Agent:00FBF84C, Clients: [eoFBF828, e0FBF884, 0eFBF7Ee, 1, this:8eFBF7C41 All done! AgentClientRel destroyed 00FBF7C4 lient destroyedeeFBF7Ee Client destroyed geeFBF884 lient destroyed ooFBF 828 Agent destroyed eeFBF84C Agent Class (Skeleton) class Agent private: string agName; public: Agent (string value) agName value; Agent) cout

Expert Answer


Answer to a Cr+ app to represent in the form of classes various company. In this project, you are asked to design and implement th… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *