Asked by billy
Develop a class diagram for a Message class for a cell phone company. Include generalizations for child
classes TextMessage, VideoMessage, and VoiceMessage.
The Message class has attributes of account number and price. In addition it has the methods
getInfo(accountNum) and calcPrice().
The subclasses each have one additional attribute of thier own. TextMessage has characterLength,
VideoMessage has messSize and VoiceMessage has numMinutes.
Each subclass overrides the methods of the superclass with thier own. No getter or setter methods need to
be documented.
The message class will have a constructor that takes the account number as an argument. Each subclass should also have their own constructor which takes their respective additional attribute as an argument; as well as the account number, obviously.
classes TextMessage, VideoMessage, and VoiceMessage.
The Message class has attributes of account number and price. In addition it has the methods
getInfo(accountNum) and calcPrice().
The subclasses each have one additional attribute of thier own. TextMessage has characterLength,
VideoMessage has messSize and VoiceMessage has numMinutes.
Each subclass overrides the methods of the superclass with thier own. No getter or setter methods need to
be documented.
The message class will have a constructor that takes the account number as an argument. Each subclass should also have their own constructor which takes their respective additional attribute as an argument; as well as the account number, obviously.
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.