Question & Answer: Given is the class diagram modeling a simple system design: Identify the cou…..

5. Given is the class diagram modeling a simple system design: Final Exam, page 9 makeCoffee coffeeCup amount: integer carLocation: String myCoffee: coffeeCup addCoffee(amount); main() cupOfCoffee: integer remainCoffee: integer setCarLocation(carLocation); checkEmpty(remainCoffee); (myCoffee.drinkCoffee(3);) drinkCoffee(cupOfCoffee) { amount = amount-cupo[Coffee; checkEmpty(amount): a) [0.5 mark] Identify the coupling level among makeCoffee and coffeeCup, provide a brief explanation b) [0.5 mark] Identify the coherence level of the class coffeeCup and provide a brief explanation c) 12 marks] Restructure the model to improve the design (focus on the cohesion and coupling level). You can make any modification to it as long as the functionality of the program is not changing.

Given is the class diagram modeling a simple system design: Identify the coupling level among makeCoffee and coffeeCup, provide a brief explanation. Identify the coherence level of the class coffeeCup and provide a brief explanation Restructure the model to improve the design(focus on the cohesion and coupling level). You can make any modification to it as long as the functionality of the program is not changing.

Expert Answer

 

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Given is the class diagram modeling a simple system design: Identify the cou…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Question & Answer: Given is the class diagram modeling a simple system design: Identify the cou..... 1Relationship between coffeecup->makecoffe shows that the 1:6 the drink coffee->amount

hence the couple level is 1:6

c) the cohesion and coupling can be reduced by slicing.

Still stressed from student homework?
Get quality assistance from academic writers!