15 lines
398 B
Java
15 lines
398 B
Java
|
public class OrderEntry {
|
||
|
private Product orderProduct;
|
||
|
private int entryAmount;
|
||
|
public OrderEntry(Product product, int amt) {
|
||
|
this.orderProduct = product;
|
||
|
this.entryAmount = amt;
|
||
|
}
|
||
|
public int calcPrice() {
|
||
|
return this.entryAmount * this.orderProduct.getPrice();
|
||
|
}
|
||
|
public String toString() {
|
||
|
return ("Product: " + this.orderProduct.getName() + ", Amount: " + this.entryAmount);
|
||
|
}
|
||
|
}
|