Page 1 of 1

As we refine a Class Model, one thing to consider is changing the 'location' of attributes through inheritance. Many of

Posted: Fri May 20, 2022 5:04 pm
by answerhappygod
As We Refine A Class Model One Thing To Consider Is Changing The Location Of Attributes Through Inheritance Many Of 1
As We Refine A Class Model One Thing To Consider Is Changing The Location Of Attributes Through Inheritance Many Of 1 (132.11 KiB) Viewed 51 times
As we refine a Class Model, one thing to consider is changing the 'location' of attributes through inheritance. Many of the classes have attributes, and some attribute values are shared among multiple classes. When all subclasses have a particular attribute in common, we might move this attribute to the superclass. Considering our Restaurant example, which of the attributes listed below would be good candidates for raising to a superclass? Select all that apply. Note: there is a negative score for selecting an attribute that should not be raised. Payment Customer Order Item BeefBurger amount number quantity:int doubleBeef:bool total() = number cheese:bool cost() = number Change Employee cost = number amount number Burger Chicken Burger Cashier GrillCook cost() = number cheese:bool greenChili:bool Fries costo = number size:int FryCook Server Soda cost() = number size:int flavor string Beverage cost() = number Manager BeverageCook cost() = number Shake flavor string cost() = number doubleBeef quantity size greenChili flavor cheese