Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class Book, with separate interface and implementation, comprised of the following attributes: **You should have separate files for class definition and implementation: Book.h

Create a class Book, with separate interface and implementation, comprised of the following attributes:

**You should have separate files for class definition and implementation: Book.h and Book.cpp

Data members (private):

string: title

string: author

Member functions (public):

Default constructor

Sets both title and author to empty strings

Parameterized constructor

Takes two strings for initializing title and author, in this order

getTitle()

Returns title as a string

setTitle(string)

(void) Assigns title the value of the input string

getAuthor()

Returns author as a string

setAuthor(string)

(void) Assigns author the value of the input string

It is advisable to write your own test cases for each class. Test your class in Cloud9 before submitting to the autograder, as the autograder has a submission limit of 20 tries.

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_2

Step: 3

blur-text-image_3

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

What is gravity?

Answered: 1 week ago

Question

What is the Big Bang Theory?

Answered: 1 week ago