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. 6) Given the following diagram showing

ID: 3835191 • Letter: P

Question


Please explain why you chose your answer.

6) Given the following diagram showing class relationships Invoice Address Product Line Item What type of relationship is shown between Invoice and LineItem? a Line Item inherits from Invoice b) in Item aggregates Invoice c Invoice aggregates LineI Item d) Invoice inherits from L ine Item. 7) Given the following diagram showing class relationships ATM Bank Customer BankAccount What type of relationship is shown between BankAccount and customer? a customer aggregates BankAccount, indicating that a customer may have 2 bank accounts. b BankAccount aggregates customer, indicating that 2 customers may share a bank account c t depends on customer indicating that many customers may have 2 bank accounts d customer depends on BankAccount. indicating that a customer may have 2 bank accounts.

Explanation / Answer

6. line item aggregates invoice

since the symbol used here between the class lineitems and invoice is for aggregation.

and the link is from lineitems to invoice

7. bankaccount agregates customer indicating 2 customer may share a same bank account

8. triangle with width greater than or equal to 2

9. n<=0 or n==1

since from the given code it is clear the function is returning the value if value of n ie either <=0 or equals to 1