|
Item |
|
1 // joi/4/estore/Item..java
2 //
3 //
4 // Copyright 2003 Bill Campbell and Ethan Bolker
5
6 /**
7 * An Item models an object that might be stocked in a store.
8 * Each Item has a cost.
9 *
10 * @version 4
11 */
12
13 public class Item
14 {
15 private int cost;
16 private String name;
17
18 /**
19 * Construct an Item object.
20 *
21 * @param name the nme of this Item.
22 * @param cost the cost of this Item.
23 */
24
25 public Item( String name, int cost )
26 {
27 this.name = name;
28 this.cost = cost;
29 }
30
31 /**
32 * How much does this Item cost?
33 *
34 * @return the cost.
35 */
36
37 public int getCost()
38 {
39 return cost;
40 }
41
42 /**
43 * What is this Item called?
44 *
45 * @return the name.
46 */
47
48 public String getName()
49 {
50 return name;
51 }
52 }
53
|
Item |
|