Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ code: The following diagram illustrates the classes you will implement in this lab and their relationships. Author Private (-) name Type: string (-) Id

c++ code:

The following diagram illustrates the classes you will implement in this lab and their relationships.

Author

Private

(-) name Type: string

(-) Id Type: int

(-) birthdate Type: int

Public

(+) Parameterized Constructor

(+) Setters

(+) Getters

(+) printDetails : void

Book

Private

(-) title Type: string

(-) author Type: Author

(-) issueYear Type: int

(-) pages Type: int

Public

(+) Parameterized Constructor

(+) Setters

(+) Getters

(+) printDetails : void

NormalBook

EBook

(-) weight Type: int

(-) sizeInByte Type: int

(-) printType Type: string

(-) fileType Type: string

(+) Parameterized Constructor

(+) Parameterized Constructor

(+) Getters

(+) Getters

(+) Setters

(+) Setters

NOTE 1: In all of your code, do not forget to validate all user input and to make all functions that do not modify the class constant.

NOTE 2: Do not put all of your code in one file; separate implementation from the interface.

NOTE 3: Avoid duplication of code! If something is already done in the base class, do not do it again in the derived class.

Implement class Book. Function printDetails should print information about the book in a well-formatted manner.

Implement class NormalBook, which inherits from class Book. Note the following:

The weight data member represents the weight of the book in grams.

The printType data member can be either Hard-Cover or Paperback.

Function printDetails of the base class should be overridden to print the additional information about the weight and print type.

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

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions