Question: WORK AREA Goal: Working with Aggregate classes In this example, the Course class is an aggregate class; it has instructor(a String) and a textbook (a

 WORK AREA Goal: Working with Aggregate classes In this example, the

WORK AREA Goal: Working with Aggregate classes In this example, the Course class is an aggregate class; it has instructor(a String) and a textbook (a Book) obiects as fields. The UML Diagram for the Course class is below: + instructor: String + textbook: Book +Course(instr:String, author:String, title: String): Book Is a class that has author (a String) and title (a String) as fields. The UML Diagram for the Book class is below author:String title: String + Book): + getAuthorO:String + getTitle): String + setAuthor(au:String): vold + setTitle(ti:String): void You are given the partial definition of the Course class to modify. Define the constructor for the Course class. This constructor accept three parameters, strings for instructor, author and title. Use these parameters to initialize the instance fields, instructor and textbook g the definiton of the Book slass. It has already been defined for you. You can call the methods in the Book class specified in the UML Diagram.) SUBMIT RESET x 2 of 2: 2018-02-10 13:49:04 - W 1 class Course( 3 public Book textbook; s 11 2 public String instructor I-Insert Your Code Below 8 this.instructor-instr 9 this.textbook.setAuthor (author): 0 this.textbook.setTitle(title)j 12 4End of Your Code

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!