Question

In: Computer Science

Question 3 (1 mark) : Assume that your program has classes Family, House, LivingRoom, Bedroom,Bathroom, Kitchen....

Question 3 (1 mark) : Assume that your program has classes Family, House, LivingRoom, Bedroom,Bathroom, Kitchen. What is the most appropriate relationship among the above classes. Write a UML diagram that indicates your system architecture (classes and relationships).

Solutions

Expert Solution

Hey, I have done my best to answer your question, still you face any issue, do tell me in comments, and if the solution is helpful, do upvote... Thanks :)

*****************************

In this example, We will use multiplicity and composition relationships.

Multiplicity- It is used when cardinality of one class is depicted with respect to another class. For eg- in the above example, one house may have 0 or more families. The notation 0..* depicts zero or many.

Composition- It is used to depict the formation of one class through various other classes. For eg- in this example, the house class is composed of livingRoom , bedRoom, kitchen, bathRoom and bedRoom classes.

In Composition, if the composition class is destroyed, then the sub-classes also gets destroyed. That is, the existence of contained classes (Bedroom, LivingRoom, kitchen, Bathroom) depends on container class(House).  

Compostion is represented directional line connecting the two classes, with a filled diamond shape adjacent to the container class and the directional arrow to the contained class.


Related Solutions

1. Rooms in a house (Bedroom, Bathroom, Living Room, etc.) are an example of a variable...
1. Rooms in a house (Bedroom, Bathroom, Living Room, etc.) are an example of a variable that follows which scale of measurement?             a. ratio scale             b. interval scale             c. nominal scale             d. ordinal scale 2. The top 10 ranked jobs based on various criterion are listed below. Here we are interested in looking at the stress rating of each job (I picked the right one in terms of stress!...also note how many jobs that are ranked...
Question 1 of 4 A family plans to have 3 children. For each birth, assume that...
Question 1 of 4 A family plans to have 3 children. For each birth, assume that the probability of a boy is the same as the probability of a girl. What is the probability that they will have three children of the same gender? A- 0.5 B- 0.25 C- 0.375 D-0.125 E-none of these Question 2 of 4 A person in a casino decides to play blackjack until he loses a game, but he will not play more than 3...
Please program in C++ Create two classes, HUSBAND (Family Member 1) and WIFE (Family Member 2)....
Please program in C++ Create two classes, HUSBAND (Family Member 1) and WIFE (Family Member 2). Make WIFE as friend class of HUSBAND. The structure of classes are given below. class WIFE; class HUSBAND { private:                 string Husband_fname;                 string Husband_lname;                 int Husband_income; public:                 HUSBAND(string f1, string l1, int inc):Husband_fname(f1), Husband_lname(l1), Husband_income(inc);                 HUSBAND();                 {                 //            Default initializations of data members                 }                 int getIncome();                 }; class WIFE { private:                 string Wife_fname;...
1 (a) Assume that the lights in your kitchen use 300 watts. How much energy and...
1 (a) Assume that the lights in your kitchen use 300 watts. How much energy and how much does it cost to leave the lights on 24 hours a day for a week if electricity is 8 cents/kilowatt hour? (b) For a month (assume 30 days/month)? (c) For a year? ----------------------------------------------------------------------------------------------------------------------- 2 (a) How much energy and how much money do you use to run your window air conditioner rated at 1500 watts continuously for the month of July (assume...
Question 6: (1 mark) An mRNA has the following codon: 5? GCA 3?. What tRNA anticodon...
Question 6: (1 mark) An mRNA has the following codon: 5? GCA 3?. What tRNA anticodon will bind to this codon? The tRNA anticodon 5'  3' will bind to the mRNA codon 5' GCA 3'. **Please enter your sequence in the 5' to 3' direction. Deductions will be made if a sequence is inputted in the wrong direction.** 1 points    QUESTION 7 Question 7: (1 mark) A tRNA anticodon has the following sequence: 3' CUA 5'. What amino acid does...
Question 1: What are the benefits and costs of a traditional family (man works/woman keeps house)?...
Question 1: What are the benefits and costs of a traditional family (man works/woman keeps house)? What type of insights into marriage can be gleaned from studying same-sex marriages?
This assignment uses a combination of classes and arrays. Instructions: 1) download the 3 program files...
This assignment uses a combination of classes and arrays. Instructions: 1) download the 3 program files into a new C++ project.    NOTE: if your IDE does not allow you to create projects - or you are not sure how to do it - then you may combine the two cpp files into a single file. 2) Complete the program by adding code the the class methods. You may want to study the existing code first to get a feel...
A family has four children, of age 3, 6, and 16 and 16 . Let’s assume...
A family has four children, of age 3, 6, and 16 and 16 . Let’s assume that the probability of giving birth to a boy is the same as the probability of giving birth to a girl. Determine the following probabilities: (a) that all 4 children are girls (b) that at least two of the children are boys (c) that the oldest child is a girl (d) that only three children are of the same gender (e) Given that you...
Question 3 You are doing genetic studies on a family that has several members with a...
Question 3 You are doing genetic studies on a family that has several members with a particular disease. You identify a gene with a one base pair difference (C→T) between the patients (T) and a healthy relative (C). This gene encodes a protein that acts as an enzyme in cellular metabolism. (A) Describe two ways in which a C→T mutation in the DNA could cause a loss-of-function disruption in a protein. (B) Describe how it is possible that a loss-of-function...
Question No 1: (3+2+2+3=10 Marks) Assume that you are a newly appointed partner in your audit...
Question No 1: (3+2+2+3=10 Marks) Assume that you are a newly appointed partner in your audit firm. Your first assignment was to handle the audit of your firm’s newest client, Marhoon Ltd. Marhoon Ltd. is a trading business that offers goods in a physical store and an on-line shop. The business has a young, modern vibe to it that it was a hit among young adults and teenagers. It is very important to have good relationship with this client since...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT