-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElectronicItem.java
More file actions
90 lines (73 loc) · 2.36 KB
/
ElectronicItem.java
File metadata and controls
90 lines (73 loc) · 2.36 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* @author Zachary Devore
* Date: 3/9/26
* Section: CSC 311-002
*/
public class ElectronicItem extends ShelfStable {
/** Brandname of the Item */
private String brand;
/** Number of months the warrenty covers */
private int warrantyMonths;
/** the power usage of the device in Watts */
private double powerWatts;
/** Wheather or not the item is rechargable */
private boolean isRechargeable;
/**
* Initialize a new instance of Electronic Item
* @param itemID
* @param price
* @param quantity
* @param brand
* @param warrantyMonths
* @param powerWatts
* @param isRechargeable
*/
public ElectronicItem(int itemID, String name, double price, int quantity,
String brand, int warrantyMonths, double powerWatts, boolean isRechargeable) {
super(itemID, name, price, quantity); // Calling the constructor from StoreItem
this.brand = brand;
this.warrantyMonths = warrantyMonths;
this. powerWatts = powerWatts;
this.isRechargeable = isRechargeable;
}
/**
* Getter for the brand
* @return the brand name of the item
*/
public String getBrand() {return this.brand;}
/**
* Getter for the warrenty
* @return number of months the warrenty covers
*/
public int getWarrantyMonths() {return this.warrantyMonths;}
/**
* Getter for the power usage
* @return power usage in Watts
*/
public double getPowerWatts() {return this.powerWatts;}
/**
* Getter for wheather the item is rechargable or not
* @return wheather the item is rechargable
*/
public boolean getIsRechargable() {return this.isRechargeable;}
/**
* Sets the brand of the item
* @param brand
*/
public void setBrand(String brand) {this.brand = brand;}
/**
* Sets the warrenty months of the item
* @param warrentyMonths
*/
public void setWarrentyMonths(int warrentyMonths) {this.warrantyMonths = warrentyMonths;}
/**
* Sets the power usage of the item
* @param powerWatts
*/
public void setpowerWatts(double powerWatts) {this.powerWatts = powerWatts;}
/**
* sets if the item is rechargable
* @param isRechargable
*/
public void setIsRechargable(boolean isRechargable) {this.isRechargeable = isRechargable;}
}