Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Language Aggregation Instructions: Make a code Using Aggregation Following the Example below With the course, as the super class, Instructor and Textbook as the

Java Language Aggregation

Instructions: Make a code Using Aggregation Following the Example below With the course, as the super class, Instructor and Textbook as the sub class. Make a code that showsVehicle as super class. and motercycle and bus as sub classes. attributes to get for car is company of car,model for car,color of car. The super class vehicle should say vehicle. Have Aggregated UML as well for all 3 classes. Need to have at least one method in every class. **Read What textbook says**

I Will Thumbs Up

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

image text in transcribed

8.7 Aggregation CONCEPT: Aggregation occurs when an instance of a class is a field in another class. In real life, objects are frequently made of other objects. A house, for example, is made of door objects, window objects, wall objects, and much more. It is the combination of all these objects that makes a house object When designing software, it sometimes makes sense to create an object from other objects For example, suppose you need an object to represent a course that you are taking in college. You decide to create a Course class, which will hold the following information: VideoNote Aggregation .The course name .The instructor's last name, first name, and office number The textbook's title, author, and publisher In addition to the course name, the class will hold items related to the instructor and the textbook. You could put fields for each of these items in the Course class. However, a good design principle is to separate related items into their own classes. In this example, an Instructor class could be created to hold the instructor-related data and a TextBook class could be created to hold the textbook-related data. Instances of these classes could then be used as fields in the Course class. Let's take a closer look at how this might be done. Figure 8-11 shows a UML diagram for the Instructor class. To keep things simple, the class has only the following methods: A constructor, which accepts arguments for the instructor's last name, first name, and office number A copy constructor . A set method, which can be used to set all of the class's fields A toString method Figure 8-11 UML diagram for the Instructor class Instructor - lastName : String -firstName String - officeNumber String + Instructor(Iname: String, fname: String office String) + Instructor(object2 : Instructor) + set (Iname : String, fname : String office : String): void + toString) : String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt AI 3 7 0 . / grouppost

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago

Question

=+How will this affect the recruiting process?

Answered: 1 week ago