Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

17.(28 pts) Book with Pages (Parts a -c). Let's say we need to design two classes, one named Page and one named Book. Each Page

image text in transcribed image text in transcribed

17.(28 pts) Book with Pages (Parts a -c). Let's say we need to design two classes, one named Page and one named Book. Each Page consists of an integer page number and no more than 500 English characters. The sequence of characters on a Page is always terminated by the null character. A Book consists of a title with no more than 50 characters (terminated by a null character) and no more than 650 Pages. (10 pts) Declare the Page class based on the description above. There are many operations that we could define for a Page, but we are only going to look at a subset for this problem. All attributes should be private. The class should declare the following member operations/functions only: a. i. fi. (2 pts) A constructor with one parameter for setting the page number (2 pts) A const function called getPageNumber () for getting the page number ifi. (2 pts) A const function called getIsCurrentPage for getting the status of the page, i.e if it is the current page being read (true) or not (false (2 pts) A function called printPage () for displaying each character on the page to the screen (should not be done by overloading the stream insertion operator). This function should not accept any arguments and should not return a value. iv. class Page public: // Should contain four prototypes/declarations retum misCane Poge Nunber P t Page Number( ) in ge retum Roge Number private: I/ Should contain three attributes- one has been provided below bool mlsCurrentPage;/ true if this page is the current one being viewed; false otherwise /1 1 pt / data member 2 data members required! int poge Number char Cortent

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

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions