Skip to content
Snippets Groups Projects
Commit 7994ea71 authored by Launo Isto's avatar Launo Isto
Browse files

Upload New File

parent 0292a7d6
Branches feature/vr
No related tags found
Loading
public class Asiakas {
private String asiakasNumero;
private String nimi;
private double ostojaTehty;
public Asiakas(String asiakasNumero, String nimi,
double ostojaTehty) {
this.asiakasNumero = asiakasNumero;
this.nimi = nimi;
this.ostojaTehty = ostojaTehty;
}
public String getAsiakasNumero() {
return asiakasNumero;
}
public void setAsiakasNumero(String asiakasNumero) {
this.asiakasNumero = asiakasNumero;
}
public String getNimi() {
return nimi;
}
public void setNimi(String nimi) {
this.nimi = nimi;
}
public double getOstojaTehty() {
return ostojaTehty;
}
public void setOstojaTehty(double ostojaTehty) {
if (ostojaTehty >= 0) {
this.ostojaTehty = ostojaTehty;
}
}
public void lisaaOsto(double hinta) {
if (hinta >= 0) {
this.ostojaTehty += hinta;
}
}
public int getAlennusprosentti() {
if (ostojaTehty <= 200) {
return 0;
} else if (ostojaTehty <= 1000) {
return 5;
} else if (ostojaTehty <= 2500) {
return 10;
} else {
return 15;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment