Repository navigation
Expand file tree
/
Copy pathProduct.java
More file actions
72 lines (60 loc) · 1.65 KB
/
Copy pathProduct.java
File metadata and controls
72 lines (60 loc) · 1.65 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
package ECommerceApplication;
public class Product {
private String name;
private String color;
private String category;
private int stockQuantity;
private double weight;
private String description;
public Product(String name,String color,String category,
int stockQuantity,double weight,String description){
this.name = name;
this.color = color;
this.category = category;
this.stockQuantity = stockQuantity;
this.weight = weight;
this.description = description;
}
public void StockControl(int purchasedQuantity) {
if (stockQuantity >= purchasedQuantity) {
} else {
System.out.println("Insufficient stock for " + name + "."+ "The order has not recieved");
}
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getCategory() {
return category;
}
public void setCatagory(String category) {
this.category = category;
}
public int getStock() {
return stockQuantity;
}
public void setStock(int stock) {
this.stockQuantity = stock;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}