-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTV.java
More file actions
64 lines (53 loc) · 2.53 KB
/
TV.java
File metadata and controls
64 lines (53 loc) · 2.53 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
/**
* @author Zachary Devore
* Date: 3/13/26
* Section: CSC 311-002
*/
public class TV extends ElectronicItem {
/** Whether is not the TV is a smart TV */
private boolean isSmart;
/** Whether or not the TV is compatible with a vesa mount */
private boolean isVesaCompatible;
/**
* Constructor for a Samsung TV
*/
public TV(int itemID, String name, double price, int quantity,
String brand, int warrentyMonths, double powerWatts, boolean isRechargeable,
boolean isSmart, boolean isVesaCompatible) {
super(itemID, name, price, quantity, brand, warrentyMonths, powerWatts, isRechargeable); // Calling constructor from ElectronicItem
this.isSmart = isSmart;
this.isVesaCompatible = isVesaCompatible;
}
/** @return Whether or not the TV is smart or not */
public boolean getIsSmart() {return this.isSmart;}
/** @return Whether or not the TV is VESA compatible */
public boolean getIsVesaCompatible() {return this.isVesaCompatible;}
/**
* Sets whether or not the TV is smart
* @param isSmart
*/
public void setIsSmart(boolean isSmart) {this.isSmart = isSmart;}
/**
* Sets whether or not the TV is VESA compatable
* @param isVesaCompatable
*/
public void setIsVesaCompatible(boolean isVesaCompatible) {this.isVesaCompatible= isVesaCompatible;}
/**
* Represents a TV with the attributes ItemID, Price, Quantity, Brand, Warrenty Months,
* Power Watts, isRechargable, isSmart, isVesaCompatable.
*/
@Override
public String toString() {
return String.format("ItemID: %d\t|\tName: %s\t|\tPrice: $%.2f\t|\tQuantity: %d\t|\tBrand: %s\t|\tWarrenty Months: %d\t|\tPower Consumption in Watts: %.2f\t|\tIs Rechargeable? %b\t|\tIs a Smart TV? %b\t|\tIs VESA Compatable? %b",
getItemID(), getName(), getPrice(), getQuantity(), getBrand(), getWarrantyMonths(), getPowerWatts(), getIsRechargable(), getIsSmart(), getIsVesaCompatible());
// return "ItemId: " + this.getItemID() +
// "\nPrice: " + this.getPrice() +
// "\nQuantity: " + this.getQuantity() +
// "\nBrand: " + this.getBrand() +
// "\nWarrenty Months: " + this.getWarrentyMonths() +
// "\nPower Watts: " + this.getPowerWatts() +
// "\nisRechargable: " + this.getIsRechargable() +
// "\nIsSmart: " + this.getIsSmart() +
// "\nVesa Compatible: " + this.getIsVesaCompatible();
}
}