-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegItem.java
More file actions
53 lines (43 loc) · 958 Bytes
/
RegItem.java
File metadata and controls
53 lines (43 loc) · 958 Bytes
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
package assignment6;
/**
* A regular item object.
*
* @author Rían Adamian
* @since 13/11/2018
*/
public class RegItem extends Item{
private String name;
private double price;
private String type;
public RegItem(String name, double price, String type) {
this.name = name;
this.price = price;
this.type = type;
}
/**
* The purpose of this secondary constructor is to change the Item-of-the-day selection easily.
*
* @param item The Item-of-the-day to be made a regular menu item.
*/
public RegItem(DiscountItem item) {
this.name = item.getName();
this.price = item.getPrice();
this.type = item.getType();
}
@Override
public String getName() {
return this.name;
}
@Override
public double getPrice() {
return this.price;
}
@Override
public String getType() {
return this.type;
}
@Override
public String toString() {
return (this.type + ": " + this.name + ", Price: " + this.price);
}
}