Question: Goal: Working with Aggregate classes In this example, the Course class is an aggregate class; it has instructorta String) and a textbook (a Book) obiects
Goal: Working with Aggregate classes In this example, the Course class is an aggregate class; it has instructorta 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): k 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 + getAuthor):String + getTitle): String + setAuthor(au:String): void + setTitle(ti: String): void You are given the partial definition of the Course class to modity, Define the constructor for the Course class. This constructor accepts three parameters, strings for instructor, author and title. Use these parameters to initialize the instance fields, instructor and textbook (NOTE: Do not worry about writing the definiton of the Book class. It has already been defined for you. You can call the methods in the Book class specified in the UML Diagram.) 1 of 1: Fri Feb 09 2018 21:29:43 GMT-0500 (EST) SUBMIT RESET 1 class Courset 2 public String instructor: 3public Book textbook 5 // Insort your Code Below "-- 9 1/---End of Your Code 10 1//end elass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
