Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions