Exercise2BackgroundThis assignment asks you to model a coffee store application.DescriptionGourmet
Exercise 2
Background
This assignment asks you to model a coffee store application.
Description
Gourmet Coffee is a store that sells coffee from countries around the globe. It also sells coffee brewing machines and other accessories for coffee consumption. The Gourmet Coffee System maintains a product catalog, processes orders, and tracks the store's sales.
The catalog maintains the following information about the store's products:
[--]CoffeeCodeDescriptionPriceCountry of originType of roastFlavorAromaAcidityBody
[---]Coffee brewerCodeDescriptionPriceModel of the brewerType of the water supply: Pour-over or AutomaticCapacity: number of cups
[---]Coffee accessoryCodeDescriptionPrice
The following tables show some of the products sold by Gourmet Coffee.
Figure 1 Coffee
Figure 2 Coffee brewers
Figure 3 Coffee accessories
The Gourmet Coffee System processes orders. An order contains a list of products, their quantities, and the total cost. The following is an example of an order:
Figure 4 Order
In the Gourmet Coffee System, the user can:
Display the catalog: lists the code and description of each productDisplay a productDisplay the current order: lists quantity, code, and price of each product in the current order, and the total of the order.Add a product to the current order—if the specified product is already part of the order, this command will modify the quantity of that productRemove a product from the current orderRegister the sale of the current order—this command adds the order to the store's sales and empties the current orderDisplay the sales: lists all the orders that have been soldRun the sample executable that is provided to learn more about the Gourmet Coffee System.
Files
Following is a sample executable of the Gourmet Coffee System.
gourmet-coffee-sample-executable.jar — Download this file now. It is a sample executable.
Tasks
These steps will guide you for completing this assignment:
First, run the sample executable by issuing the following command at the command prompt:
C:\>java -jar gourmet-coffee-sample-executable.jar
Then, follow the technique described in page 1.2.5 Modeling Classes to model the Gourmet Coffee System.
Identify the following:
The classes
The association relationships (include direction, multiplicity, and association attribute)
The specialization/generalization relationships
The attributes of each class
The methods of each class
Your class diagram should include:
The class of the gourmet coffee application
The accessor methods
The mutator methods if are needed
For the collections:
The methods to add and access elements
The methods to remove elements if are needed
The methods that compute other values not included in the attributes.
Use Sun's coding conventions when naming classes, methods, and attributes.
Use Eclipse, Violet, PowerPoint, or another tool of your choosing to draw a UML class diagram.
Save the UML class diagram in a SVG, GIF, or JPG format in a file named uml-gou-cof.
下面是提交的UML图片..