-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct.java
executable file
·55 lines (45 loc) · 1.14 KB
/
Product.java
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
/**
* Prodcut class holds the products' name, quantity, price, and imported tax status
* (whether the product is exempt from the tax or not).
*
* @author Vanessa Esli Tovar
*/
public class Product{
// fields
private String name;
private int quantity;
private float price;
private boolean imported; //does imported tax apply to this product?
public Product(String name, int quantity, float price, boolean imported){
this.name = name;
this.quantity = quantity;
this.price = price;
this.imported = imported;
}
/**
* Getter method for the product name.
*/
public String getName(){
return this.name;
}
/**
* Getter method for the product quantity.
*/
public int getQuantity(){
return this.quantity;
}
/**
* Getter method for the product price.
*/
public float getPrice(){
return this.price;
}
/**
* Getter method for the product's imported tax status.
*/
public boolean isImported(){
return this.imported;
}
public static void main(String[] args){
}
}