Question: 1. Create a Chapter class with a chapter title and a number of pages - write the UML and then write the class. Make sure

1. Create a Chapter class with a chapter title and a number of pages - write the UML and then write the class. Make sure your class has a toString method that returns a string of the chapters title and the number of pages;

2. Create a Book class with author, title, publish year, and an array of Chapters - write the UML then write the class. Make sure your Book class has a toString method that returns a string of the author, title, year. Then loops thru the array of chapters to add the chapters;

3. Create a TestBook class(and UML for classes) to test the book;

The output should look like this: Sierra, Title: Java, Publish Year: 2003; Chapters: Intro, 37 pages; Variables, 102 pages; Data Types, 169 pages;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!