-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHouseholdItem.java
More file actions
61 lines (49 loc) · 1.84 KB
/
Copy pathHouseholdItem.java
File metadata and controls
61 lines (49 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* HouseholdItem represents general household products sold in the store.
* It extends StoreItem and adds attributes specific to household goods.
*/
public class HouseholdItem extends ShelfStable {
/** Weight of the household item */
private double weight;
/** Material the item is made of */
private String material;
/** Area where the item is typically used (kitchen, bathroom, etc.) */
private String areaOfUse;
/**
* Creates a new HouseholdItem
* @param itemID Unique ID for the item
* @param price Price of the item
* @param quantity Quantity available in the store
* @param weight Weight of the item
* @param material Material the item is made of
* @param areaOfUse Area where the item is used
*/
public HouseholdItem(int itemID, String name, double price, int quantity,
double weight, String material, String areaOfUse) {
super(itemID, name, price, quantity);
this.weight = weight;
this.material = material;
this.areaOfUse = areaOfUse;
}
/** @return the weight of the item */
public double getWeight() { return this.weight; }
/** @return the material of the item */
public String getMaterial() { return this.material; }
/** @return the area where the item is used */
public String getAreaOfUse() { return this.areaOfUse; }
/**
* Setter for Weight
* @param weight
*/
public void setWeight(double weight) { this.weight = weight; }
/**
* Setter for Material
* @param material
*/
public void setMaterial(String material) { this.material = material; }
/**
* Setter for areaOfUSe
* @param areaOfUse
*/
public void setAreaOfUse(String areaOfUse) { this.areaOfUse = areaOfUse; }
}