Question

Computer Programming II CS141(Java) Mention the appropriate relationship between following classes: HOD–StaffMember Car–Ferrari Student-Address BankAccount–FixedAccount House-Building...

Computer Programming II CS141(Java)

  1. Mention the appropriate relationship between following classes:
  1. HOD–StaffMember
  2. Car–Ferrari
  3. Student-Address
  4. BankAccount–FixedAccount
  5. House-Building
  6. Department-Teacher
  7. Traffic–TrafficSign
 
  1. Provide the UML diagram for the following program.
 
               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.

1 is-a

2 instance

3 aggregation

4 is-a

5 composition ; considering a building that has many houses

6 composition

7 association


Parent getBike Inhenitence main() Child getCar0)

Add a comment
Know the answer?
Add Answer to:
Computer Programming II CS141(Java) Mention the appropriate relationship between following classes: HOD–StaffMember Car–Ferrari Student-Address BankAccount–FixedAccount House-Building...
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
  • 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();...

  • What is the output for the following program codes? a) [ 0.5 Mark ] class A...

    What is the output for the following program codes? a) [ 0.5 Mark ] class A { int i; } class B extends A { int j; void display() { super.i = j + 1; System.out.println(j + " " + i); }} class inheritance { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); }} OUTPUT: b) [ 0.5 Mark ] class Parent { public void getBike(){ System.out.println("Suzuki Bike"); }} class Child extends Parent {...

  • I need help writing my main method**** Computer Science 111 Introduction to Algorithms and Programming: Java...

    I need help writing my main method**** Computer Science 111 Introduction to Algorithms and Programming: Java Programming Project #4 – Classes and Objects (20 Points) You will create 3 new classes for this project, two will be chosen from the list below and one will be an entirely new class you invent.Here is the list: Shirt Shoe Wine Book Song Bicycle VideoGame Plant Car FootBall Boat Computer WebSite Movie Beer Pants TVShow MotorCycle Design First Create three (3) UML diagrams...

  • Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you w...

    Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you will build the below hierarchy: Overview: You will implement the supplier code: Shape, Square, TSquare, and Triangle, which will be used by the Homework7Main program. This program will use the DrawingPanel to draw these objects onto a canvas. Specification: You will take advantage of inheritance with using a super class, Shape.java. (below) Shape is an abstract class, which means it can be extended, but...

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