You have been requested to develop the logic for program to process a class call
ID: 3838300 • Letter: Y
Question
You have been requested to develop the logic for program to process a class called RetailItem. This class contains the following attributes: item description, units in inventory, and price. This class is also suppose to contain the following methods A method named purchase_item that used to purchase an item from the inventory A method named get_total that recovers the cost of an item A method show_item that display the description of a item and its cost With the above information draw a UML class diagram (see page 358 in your book). The simplest way to do this is use Word and create a table in your document that has one column and three rows. Note that in this case, you only have one class that you need to diagram.
Explanation / Answer
The UML diagram for the required problem statement is
+ String item_description
+ int unit_in_inventory
+ float price
+ void purchase_item()
+ int get_total()
+ void show_item()
RetailItem+ String item_description
+ int unit_in_inventory
+ float price
+ void purchase_item()
+ int get_total()
+ void show_item()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.