Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started