-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaitlistItem.java
More file actions
41 lines (34 loc) · 923 Bytes
/
Copy pathWaitlistItem.java
File metadata and controls
41 lines (34 loc) · 923 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
// import java.util.*;
import java.io.*;
public class WaitlistItem implements Serializable {
private static final long serialVersionUID = 1L;
private Client client;
private Product product;
private int quantity;
// Constructor
public WaitlistItem(Client client, Product product, int quantity) {
this.client = client;
this.product = product;
this.quantity = quantity;
System.out.println(toString());
}
public Client getClient() {
return client;
}
public Product getProduct() {
return product;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int q) {
quantity = q;
}
public double getPrice() {
return product.getPrice() * quantity;
}
public String toString() {
return "product name: " + product.getName() + " for client ID: " + client.getId()
+ " | quantity needed: " + quantity + " | price: " + getPrice();
}
}