Question: Task 1 (Aggregation): Implement the following book and chapter aggregation. A book can have maximum of 3 chapters. You can use array or declare 3

Task 1 (Aggregation): Implement the following book and chapter aggregation. A book can have maximum of 3 chapters. You can use array or declare 3 objects in the Book class. Book - title: string - chp[3]: Chapter Chapter - name: string - number: int - pages: int has a + Book + Book(string) + totalPages(): void + Chapter() + setValues(): void + getPages(): int int main() { // sets the title of book and call setValues() of each chapter to input data // calculate total pages from all chapters in book } Expected working: Enter chapter name: arrays Enter chapter number: 1 Enter number of pages: 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
