Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please explain why you chose your answer. 1) A class (classone) is considered to

ID: 3834365 • Letter: P

Question

Please explain why you chose your answer.

1) A class (classone) is considered to have a dependency on another class (classTwo) under which of the following conditions? a Each class uses objects of the other b The public interfaces of both classes are cohesive. c) classTwo uses objects of classone d Classone uses objects of classTwo 2) Which statement correctly describes the class relationship shown in this diagram? CashRegister Coin a) CashRe ister class depends on coin. class b) Coin class depends on CashRe ister class c) CashRe ister class aggregates coin class d coin class inherits from CashRegister class 3) Which statement correctly describes the class relationship shown in this diagram? Question Quiz a Quiz class depends on Question class b) Question class aggregates Quiz class c) Quiz class aggregates Question class. d) Question class inherits from Quiz class.

Explanation / Answer


1)
   a) Each class uses objects of the other

   False. If classTwo used classOne then classOne does not have any dependency
   on classtwo.

   b) False.
   c) False
   d) True: If classOne is using object of classtwo, then in this case
   classOne has some dependency on classtwo

2)
   Ans: d) CashRegister class depends on Coin class

   -------> show dependency
   Ex: Car --- has a --> Door

3)
  
   ans: c) Quiz class aggregates Questions clas

   <>------ shows aggregation
5)
   Ans) d) Car class inherits from Vehicle class