Question

Assuming that your program has classes Family, House, LivingRoom, Bedroom, Bathroom, Kitchen, Garage. What is the...

Assuming that your program has classes Family, House, LivingRoom, Bedroom, Bathroom, Kitchen, Garage. What is the most appropiate relationship between the classes? Provide a UML class diagram that shows your system architechure.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

UML CLASS DIAGRAM:

  • Please find below the UML Class Diagram for mentioned classes.

EXPLANATION:

  • The releation between Family and House is called One-to-One association. It means, one family lives in one house. It is represented by a single line between 2 classes and mentioning association with number (i.e. 1).
  • A house can have multiple rooms such as LivingRoom, Bedroom, Bathroom, Kitchen and Garage. All the rooms are dependent on the house (i.e. Without a house, there cannot be any rooms). It is represented with tick head arrow as shown in class diagram above. This is called Composition.
  • Atleast, one house is needed which can support one-to-many rooms. Therefore, the composition is One-to-Many between house and rooms.

P.S:

  • I have given only classess without any variables or methods in the diagram, as only classes were mentioned in the question.
Add a comment
Know the answer?
Add Answer to:
Assuming that your program has classes Family, House, LivingRoom, Bedroom, Bathroom, Kitchen, Garage. What is the...
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
  • 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) Mention the appropriate relationship between following classes: HOD–StaffMember Car–Ferrari Student-Address BankAccount–FixedAccount House-Building Department-Teacher Traffic–TrafficSign 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(); }             }

  • 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();...

  • You are given a specification for some Java classes as follows.   A building has a number...

    You are given a specification for some Java classes as follows.   A building has a number of floors, and a number of windows. A house is a building. A garage is a building. (This isn’t Florida-like … it’s a detached garage.) A room has a length, width, a floor covering, and a number of closets. You can never create an instance of a building, but every object that is a building must have a method that calculates the floor space,...

  • What is the difference between behavioral UML diagrams and structure UML diagrams? Please provide your answer...

    What is the difference between behavioral UML diagrams and structure UML diagrams? Please provide your answer using specific diagramming techniques. Entity Relationship Diagram and Class Diagram are two diagramming techniques sharing common ancestry. Please contrast and compare the two. What are the similarities and the differences?

  • Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented...

    Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented design by creating an UML diagram for a Java program. Program Statement: Bank System You were asked to create a simple UML diagram for a bank system. Each bank has a specific identification number, a name, and a location that needs to be stored. Tellers serve customers’ loans, checking and savings accounts. The bank must know each tellers’ name and identification number for record...

  • using java: For this exercise, you will design a set of classes that work together to simulate a parking officer checkin...

    using java: For this exercise, you will design a set of classes that work together to simulate a parking officer checking a parked car issuing a parking ticket if there is a parking violation. Here are the classes that need to collaborate: • The ParkedCar class: This class should simulate a parked car. The car has a make, model, color, license number. •The ParkingMeter class: This class should simulate a parking meter. The class has three parameters: − A 5-digit...

  • A new city “Ballymanus” has been announced in a state in Australia and the state government...

    A new city “Ballymanus” has been announced in a state in Australia and the state government has planned to extend the public transport where the fares will be calculated according to the existing fare rule of the state. As per the existing fare system, everyone must have to buy the “Move Card” in order to travel on trains, tram, and buses in different parts of the state, including the new city. There are 2 options in “Move Card”  “Move...

  • Design a detailed UML class diagram for the Family Dental Care system. Your solution should demonstrate...

    Design a detailed UML class diagram for the Family Dental Care system. Your solution should demonstrate all three inter-class relationships, namely Association, Inheritance and Aggregation/composition. The classes should include attributes and methods. The Scenario is Given Below: Family Dental Care (FDC) is a leading up market dental surgery located in Kandy. It provides all types of dental treatments to patients which include extractions, nerve fillings, maxillofacial surgeries (i.e. surgeries involving jaw bone) and sophisticated dental implants.  It is visited by prominent...

  • CIST 2371 Introduction to Java Unit 04 Lab Due Date: ________ Create a folder called Unit04...

    CIST 2371 Introduction to Java Unit 04 Lab Due Date: ________ Create a folder called Unit04 and put all your source files in this folder. You will create a UML diagram and two Java class files and that implements the classes in the UML diagram. Diagram Create a UML diagram that shows an Account class and an AccountTester class. The Account class holds the following data as Strings: account Number, type of account, card number and expire date. Include getter...

  • Section 0 Problem Background A local entrepreneur has investments in property and vehicles. Recently business has...

    Section 0 Problem Background A local entrepreneur has investments in property and vehicles. Recently business has boomed and she needs object-oriented software to keep track of her current and past assets. As an OOP expert, you are tasked to write a program that keeps track of these assets. You are recommended to read through the requirements of all sections before attempting any coding. Section 1: Basic Classes • A House class with instance variables erfNumber, location, noOfRooms, etc. • Mandatory...

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