forked from denyskon/info-java
Igor Bartkowski
89bb3a674e
Technikladen-Aufgaben-Lösung hinzugefügt, weitere kleinere Änderungen werden noch folgen, aber funktional hiermit vollständig Reviewed-on: denyskon/info-java#1 Reviewed-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: ibartkowski <ibartkowski@git.cantorgymnasium.de> Co-committed-by: ibartkowski <ibartkowski@git.cantorgymnasium.de>
15 lines
398 B
Java
Executable File
15 lines
398 B
Java
Executable File
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);
|
|
}
|
|
}
|