Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

l T-Mobile Wi-Fi 8:19 PM In this assignment you will write a small C++ program. Your peogram should compile cormectly and produce the specified output.

image text in transcribed
l T-Mobile Wi-Fi 8:19 PM In this assignment you will write a small C++ program. Your peogram should compile cormectly and produce the specified output. Please note that the computer peogram should comply with the commenting and formatting rules as has been done in class. For example, there should be a header for the whole program that cives the auathor's name, class name, date, and description. End braces should be commenled and there are alignment and indenting roquircments as discussed. Plcase ask if you have any questions. Program #1 A bookshelf can contain zcro or more books A book contains an author, a title and zero or more chapicr. A chapter contains a title and acro or more paragraphs. A paragraph only contains text In a shelf you can add. get or remove a book. Similarly, in a book, you can add, get or removea chapler, and on each chapler, you can add, get or remove a paragraph, set/get the book it belongs to, or get a specific paragraph. Finally, in a paragraph, you can add text, set the chapter the paragraph belongs to, or get the chapter the paragraph belongs to. The shelf class has only the empty constructor, while the book class has the empty constractor, and two additional constructors: one with title and author, and another only with the title The "chapter" class has the empty constructor and an additional constructor with chapter title as paramcicr The paragraph class, contains, besides the empty constructor, a constructor with lext as parameier The three book parts (Book Title and Author Chapter, and Paragraph) all contain the method get Text. This method returns a formatted representation of that object This means that the Paragraph returns just the text content . The Chapier retums the chapter title, followed by cach paragraph. The Book returns the title, followed by the author, which is followed by all chapters a) (70 Points) Write the class(es) definition, all data memberfamributc)s and function b) (20 Points): Provide an example of usage. This is: define a bookshelf object, add at least member method)s for this problenm one book, the book (besides title and authoejshould have at least one chapter, the chapter should have at least one paragraph. Display the info of each object according to the definition abovc. (10 Points): Draw the UML Class diagram that represents the class (attributes& methods) and relations described above c) d) (20 Bonus points) Properly use of inheritance derived classes), virtual functions and linked list The header files (h) should only contain one class with the attributes and prototypes for all the required mcthods You will tum in a zip file with all the h and.cpp files source code The C source code file should 1) Comply with all of the formatting requirements already discussed. 2) Display the eutput

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

4. Show the trainees how to do it again.

Answered: 1 week ago

Question

8. Praise the trainees for their success in learning the task.

Answered: 1 week ago