Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please solve the book class in c++ solve header and it's implementation please Q1: Implement the following classes: Line class o o o attribute content
please solve the book class in c++
solve header and it's implementation please
Q1: Implement the following classes: Line class o o o attribute content (as private string) Default and initializer constructors destructor, setters and getters Define print function that prints line contents. Void concat(line &12), which concatenates the two lines contents and empty the received one. HasSameContent(Line &12) which compares two objects and returns back true if they both have the same exact content. O O . Page class O two private members: 1) array of 30 lines and 2) page number. The constructor should ioitialize the lines to empty string and page number to 0. Destructor o O O Setters (lines and page number) and one getter for page number AddLine member function that receives a line object and adds it to current page. The line will be added after last non-empty line. If number of lines is already 30, it will display a message "cannot add line, page is full". print function that prints page lines line by line. HasMorelines(Page &p2) which compares the two pages and return back true if original object has more Lines than object p2. Book class, private attributes: 1)a dynamic array of pages, 2) the current number of pages. Constructor and copy constructor O O O Destructor Getter for number of pages AddPage member function. It receives a page object and adds it to the book. Each time a page is added, it is assigned a page number based on sequence of addition. Print function to print the book pages page by page, the function should print a separator line between every two pages. O
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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