I want to do a class design and code implementation for an electronic book (or ebook), which is in its structure similar to an ordinary book.
The ebook i want to design has a title, an author and a publisher. It consists of a number of pages. Each page contains text and one picture; each picture has a subtitle.
It want it to include the following features title, author, publisher and subtitle are strings limited to 40 characters.
The ebook might consist of up to 100 pages.
The text within one page is limited to 255 characters.
A picture is stored as a black and white bitmap consisting of 50 by 50 pixels (use the Boolean type to represent one pixel).
I want to design classes for ebook, page and picture and then link them together in an appropriate way.
I want all the class attributes to be private.
I don't want any magic numbers in the code (e.g. array dimension etc); i want to use const expressions instead.
I can either do the design fully static (e.g. an ebook consists of exactly 100 pages, see police.zip) or use a dynamic approach (the pages are dynamically created and linked together, see list.zip).
I want to define and implement methods to fill an ebook with some useful information, e.g. title, author, publisher.I want to enter the text for a chosen page or the subtitle of the picture for a chosen page (e.g. WriteText(int page, char* text) and WriteSubtitle(int page, char* subtitle), both are methods of ebook). I want to be able to skip a similar function to deal with the bitmap of a picture.
I want to define and implement a method Read (element function of ebook), which does the following:
- it prints out the book attributes and the number of the last page, where text was assigned to.
- it iterates a loop from (“page”) zero to the last page and prints the page number, the text and the subtitle of the picture (for every single page).
In order to test my code, the main() function should create one instance of ebook, where you assign author, title and publisher. A couple of pages should be filled with some text and finally the method Read should be called.
Any help would be greatly appreciated as soon as possible.Thanking you in advance.