Skip to content
Snippets Groups Projects
Commit 8659c814 authored by Sini Lähde's avatar Sini Lähde
Browse files

Upload New File

parent 4cd02881
No related branches found
No related tags found
No related merge requests found
public class Ostotapahtuma {
private Asiakas asiakas;
private Myyja myyja;
private Tuote tuote;
private int maara;
private double hinta;
public Ostotapahtuma(Asiakas asiakas, Myyja myyja,
Tuote tuote, int maara) {
this.asiakas = asiakas;
this.myyja = myyja;
this.tuote = tuote;
this.maara = maara;
hinta = maara * tuote.getHinta();
// Vähennetään hinnasta vielä alennus
hinta = hinta - hinta * (asiakas.getAlennusprosentti() / 100.0);
}
public Asiakas getAsiakas() {
return asiakas;
}
public Myyja getMyyja() {
return myyja;
}
public Tuote getTuote() {
return tuote;
}
public int getMaara() {
return maara;
}
public double getHinta() {
return hinta;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment