Thread: Program problem

  1. #1
    Registered User
    Join Date
    Feb 2002

    Program problem

    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 or use a dynamic approach (the pages are dynamically created and linked together, see
    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.
    Micheal Morris::

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multi Thread Program Problem
    By ZNez in forum C Programming
    Replies: 1
    Last Post: 01-03-2009, 11:10 AM
  2. Program Termination Problem
    By dacbo in forum C Programming
    Replies: 3
    Last Post: 01-23-2006, 02:34 AM
  3. Inheritance and Dynamic Memory Program Problem
    By goron350 in forum C++ Programming
    Replies: 1
    Last Post: 07-02-2005, 02:38 PM
  4. Replies: 20
    Last Post: 06-12-2005, 11:53 PM