Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Language Instructions- Write detailed pseudo code for this code. I Will Thumbs Up /**Explanation The example shown here for Course is aggregation i.e. Has-A

Java Language

Instructions- Write detailed pseudo code for this code.

I Will Thumbs Up

/**Explanation

The example shown here for "Course" is aggregation i.e. "Has-A" relationship where Course has a textbook and an instructor. While the one where superclass and subclass comes into picture is "IS-A" relationship i.e.Inheritance in java.

In case of Aggregation, like here Course has objects of other two classes. While in required example the Vehicle class will be used as superclass and Motorcycle and Bus is a vehicle , hence these will extend from Vehicle. Also, you have shown me Car properties here which is not supposed to be a Class as mentioned by you as per question.

Understanding the question, I am showing an example for Inheritance i.e. "IS-A" relationship here using Vehicle, Car and Bus classes.

*/

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

UML Diagrams :-

image text in transcribed

2 3 public class Vehicle ( 4 5 String type; 6 int numofwheels; 7 8e Vehicle() 9 10 12public String toString()f 13 return "Vehicle type is" type " with Number Of Wheels"+numofwheelst"."; 14 15 16 2 3 public class Vehicle ( 4 5 String type; 6 int numofwheels; 7 8e Vehicle() 9 10 12public String toString()f 13 return "Vehicle type is" type " with Number Of Wheels"+numofwheelst"."; 14 15 16

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

Describe downsizing.

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago