info-java/Aktienhandel/Broker.java

17 lines
548 B
Java
Executable File

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);
}
}