`
Anddy
  • 浏览: 191575 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Exercise 2

    博客分类:
  • java
阅读更多
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:


    [--]Coffee
  1. Code
  2. Description
  3. Price
  4. Country of origin
  5. Type of roast
  6. Flavor
  7. Aroma
  8. Acidity
  9. Body



    [---]Coffee brewer
  1. Code
  2. Description
  3. Price
  4. Model of the brewer
  5. Type of the water supply: Pour-over or Automatic
  6. Capacity: number of cups


    [---]Coffee accessory
  • Code
  • Description
  • Price


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:

  1. Display the catalog: lists the code and description of each product
  2. Display a product
  3. Display the current order: lists quantity, code, and price of each product in the current order, and the total of the order.
  4. 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 product
  5. Remove a product from the current order
  6. Register the sale of the current order—this command adds the order to the store's sales and empties the current order
  7. Display the sales: lists all the orders that have been sold
  8. Run 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图片..
  • 大小: 214.4 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics