Question

a. Mention the appropriate relationship between following classes: [0.5 Marks] 1. HOD–StaffMember 2. Car–Ferrari 3. Student-Address...

a. Mention the appropriate relationship between following classes: [0.5 Marks]

1. HOD–StaffMember

2. Car–Ferrari

3. Student-Address

4. BankAccount–FixedAccount

5. House-Building

6. Department-Teacher

7. Traffic–TrafficSign

b. Provide the UML diagram for the following program. [ 0.5 Marks]

class Parent {

public void getBike() { System.out.println("Suzuki Bike"); } }

class Child extends Parent {

public void getCar() { System.out.println("Swift car"); } }

class inheritance { public static void main(String args[]) {

Parent p = new Parent();

p.getBike();

Child c = new Child();

c.getBike(); c.getCar(); } }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a. relationship

1. HOD–StaffMember ------ Specialization and Inheritance( HOD is subType of a StaffMember)

2. Car–Ferrari -----------Generalization and Inheritance (Ferrari is a Type of Car)

3. Student-Address -------------- Composition (Student has an Address)

4. BankAccount–FixedAccount --------------Generalization and Inheritance(FixedAccount is a Type of BankAccount)

5. House-Building ------- Aggregation( A Building has many Houses)

6. Department-Teacher ---------- Multiplicity ( A Department has many Teachers)

7. Traffic–TrafficSign -----------Composition (Traffic consist of traffic signs)

b. UML

Do ask if any doubt. Please upvote.

Add a comment
Know the answer?
Add Answer to:
a. Mention the appropriate relationship between following classes: [0.5 Marks] 1. HOD–StaffMember 2. Car–Ferrari 3. Student-Address...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT