added Aktienhandel

This commit is contained in:
2024-10-18 18:12:21 +02:00
parent 0aff196b75
commit be65e3e445
8 changed files with 184 additions and 0 deletions

16
Aktienhandel/Broker.java Executable file
View File

@ -0,0 +1,16 @@
public class Broker extends Person {
protected double provision;
protected int clientCount;
public Broker(String name, int age, double money, double provision, int clientCount) {
super(name, age, money);
this.provision = provision;
this.clientCount = clientCount;
}
public void tradeAbwickeln(Trader trader, String aktieName, double price, int amt) {
trader.aktieKaufen(aktieName, price, amt);
this.money += this.provision;
}
public void kundenAnzeigen() {
System.out.println("Kunden: " + this.clientCount);
}
}