Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ without any imported language(no Java or anything else, just C++) Program Specifications This is to implement an application to be used by Customer

Using C++ without any imported language(no Java or anything else, just C++)

image text in transcribedimage text in transcribedimage text in transcribed

Program Specifications This is to implement an application to be used by Customer Service representatives at a Wireless Phone Camier to keep trackof customers SmartPhone message usages charges and to provide account disconnect Servioe Messages can be sent from one SvartPhone account to another SmartPhone account. They can be one of the following types: Text message, Voice message, or Media message. Each message will be charged at diferentrates The assignment basically ilustrates the following oonoepts: STL Containers (std vector and std: map) .Exception handling catch blocks) Upon start up your program should show the below menu 1.List summary of message usages/charges forall accounts 2 Search a message from an account 3Erase a message from an account 4 Disconnect an account 5.Quit Data Structures Specs Since searching an account will be done frequently the ideal data structure for this application will be aSTL map of SmatPhoneaocounts with phone numbers as the keys and vectors of pointers to Messages as their value Class Smart Carrier .Private member data Carrier name "A STL map of Smartphone accounts whose values are STL vectors of pointers to Message objects Constructors/Destructor: Note that the destuctor must de-allocate memory for the vector of Message pointers for all accounts to avoid memory leak only gether/setter for carrier and getter for the STL map (retum aareferenoe to the STL map) Public member functions 'init (to populate data into the STL map see code heper at the end) StartService a do while loop that shows a menu andaswitch statement that invokes one of the below private member functions based on user choic Private member functions to be used by StartService only should not be visible to users .Menu ListAlt list all accounts with total messages and total charges of each message type SearchMessage ask for an account, a message type (ext, Voice, or Media), from, and to. If the account exists use dynamic cast to verify message type and then use the operator overload defined in Message class to determine if there isl a match. so display message information using Otherwise display an emor message (by exception handler. See below). .Erase Message: similar to SearchMessage. If found erase the message. Othenwise display an error message (by exception handler. below "DisconnectAccount ask for an account phone number. iffound erase the account from the map. Otherwise display an error message (by exception handler See below StopSerMce: invoke klstAll then write alldata to a text file (ou decide the format), then display a bye-bye message, finally terminate the program with exit statemen NOTE: For SearchMessage. EraseMessage, and Disconnectaccount use a try/catch block in each function. In the try block if an account a message is not found throwanexoeption with emor message desaibing what has gone wrong. In the exception handler fthe catch block) simply display the emor message and return "class Message (abstract class) .Private data or (string): Senders phone number .to (string): reoeivers phone number Constructors Pestnuctor YKWUR .Public member functions: a pure virtual function retum 0.0 .Overload operator to compare two items. Two items are the same if the following member data are identicat from and to .class RxtMessage, class VoiceMessage, class MediaMessage: derived from Message (keep them simple with minima member data and functions)

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

Step: 3

blur-text-image

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 Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions