473,511 Members | 16,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create a class named CleverBookMark

1 New Member
Write a complete C++ Object Oriented Program:Create a class named CleverBookMark that consists of the following attributes.

3.1.1 The CleverBookMark class consists of the following:
Data Members:
Access Data Type Name Description
Private Integer numPages The data member that will store the total number of pages in a book.
Private Integer currPageNum The data member that will store the number of the current page.
Private Integer bookMarkPageNum The data member that will store number of the book mark page.


Methods:

Access Return Type Name Description
Public ? ? The default constructor that should set the number of pages to 100 and the current and the bookmark page nr to 0 respectively.
Public ? ? An overload constructor that takes one parameter – to set the number of pages to a value sent to the constructor. The other 2 attributes must be set to 0.
Public Void setValues(…) A method that will set the values of each of the three attributes. Overload this method by one that takes only 2 parameters: one to set the current page number and the bookmark number to values sent to it.
Public Void setValues(…) A public method that will set the bookmark page number to the current page.
Public Void readPagesSetBookMark () The method that should accept a parameter to indicate the number of pages read. The current page number must then be incremented by the number of pages read and the bookmark must be moved to the current page.
Public Integer getPagesToGo() An accessor method that should return the number of pages from the current page that the user must still read to finish the book.
Public Float getPercRead() An accessor method that should return the percentage of the book read.
Public Integer getCurrentPage() An accessor method should return the current page.



3.2

3.2.1 The first object should be created using the default constructor, accepting the values assigned by the constructor as the initial values.
3.2.2 The second object should be created with the other constructor, with the number of pages set to 699.
3.2.3 For object 2, change the bookmark to be at page 100 and the current page must be set to 300.
For each book (object): ask the user how many pages have been read. Update the current page and bookmark accordingly. Display the number of pages still to read in order to finish the book, the percentage of the book read, and the current page number where the bookmark is as output to the screen. Percentages need not be rounded and can be treated as integer values.
Aug 23 '10 #1
1 1434
Meetee
931 Recognized Expert Moderator Contributor
This is an assignment for you or for us? Please put efforts to finish your own assignment. If trouble, then ask here.
Aug 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3436
by: LornaJane | last post by:
I've not done very much Java before and now I'm working on a j2me application, however I think the trouble I have is generic java. I can compile, preverify and jar everything fine, but the...
7
7896
by: Steven.Xu | last post by:
Hello everyone! I have a problem about create an instance automatically in C#. Now I have a class: namespace1.namespace11.CClass01. I want to create it's instance in a function named...
1
1689
by: Roger Gordon | last post by:
I have the VB.NET Standard Edition. I'm taking a VB.NET class in school. Last night we tried to create a class libary and there was no option to do this in the Standard Edition. Our instructor...
4
1541
by: Daylor | last post by:
hi. i have multi thread application in vb.net is there a way NET support, so i can mark the class , to be access only for 1 thread each time ? if there is , small sytax sample will help ...
8
2856
by: KP | last post by:
How can we create class which other class can't be inherited or we can say how to protect class from inheritance ? ( e.g. final class in java, if a class is final in java, then this class can't be...
0
909
by: Brian Richards | last post by:
I just cannot create a strongly named MC++ assembly. I always get an error Error 1 fatal error LNK1256: ALINK operation failed (80090007) : Bad Version of provider. There's no help anywhere....
0
929
by: JO | last post by:
hello, I have just finished a small application which makes it possible to save time when one must create classes starting from a DBMS. To test them:...
1
2074
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi This is from within an EXE that actaully contains the class - No external assembly I would do Class1 myClass = new Class1(); Now I want
1
2288
by: gundam | last post by:
I need to use Javascript in classic ASP for a project. However, I seem to have problem using javascript combined with ASP. Here are the questions: 1) ERROR to create class, see code below: <%@...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.