Draw UML diagram Define a class named Document that contains a member variable of type string named...

70.2K

Verified Solution

Question

Programming

Draw UML diagram
Define a class named Document that contains a member variable oftype string named text that stores any textual content for thedocument. Create a function named getText that returns the textfield and a way to set this value.
Next, define a class for Email that is derived from Document andthat includes member variables for the sender , recipient , andtitle of an e-mail message. Implement appropriate accessor andmutator functions. The body of the e-mail message should be storedin the inherited variable text .
Similarly, define a class for File that is derived from Documentand that includes a member variable for the pathname. Implementappropriate accessor and mutator functions for the pathname.
Each class should have a display function to display the completecontents.
Create a class Author with name and id. Author is responsible tocreate the document. It means every document should have anauthor.
Create a class Administrator with name and id. Administrator candelete the document if he finds these words (“corrupt, liar,dishonest”) in the document text.
Finally, create several sample objects of type Email and File inyour main function. Test your objects by creating a test program.Also create relationships with author and administrator withdocument.

Answer & Explanation Solved by verified expert
4.1 Ratings (571 Votes)
Please find below the steps to construct the class diagram1 Creating classesThe system will have belowclassesi Document Thisclass has below members and    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students