Aktienhandel #4

Merged
Denys Konovalov merged 22 commits from ibartkowski/info-java:main into main 2024-10-18 18:21:55 +02:00
Showing only changes of commit ddc485ddeb - Show all commits

@ -1,16 +1,14 @@
package tech_store;
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);
}
}
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);
}
}