42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package backend;
|
|
|
|
public class Bestellung {
|
|
String name;
|
|
String adresse;
|
|
double versandkosten;
|
|
double anteil7;
|
|
double anteil19;
|
|
double gesamtPreis;
|
|
|
|
public Bestellung() {
|
|
|
|
}
|
|
public Bestellung(String name, String adresse, double versandkosten, double anteil7, double anteil19, double gesamtPreis) {
|
|
this.name = name;
|
|
this.adresse = adresse;
|
|
this.versandkosten = versandkosten;
|
|
this.anteil7 = anteil7;
|
|
this.anteil19 = anteil19;
|
|
if(gesamtPreis >= 500.0) {
|
|
this.gesamtPreis = gesamtPreis - versandkosten;}
|
|
else {
|
|
this.gesamtPreis = gesamtPreis;
|
|
}
|
|
}
|
|
|
|
|
|
public String[] bestellungToArray(){
|
|
String[] bestellInfos = new String[6];
|
|
bestellInfos[0] = name;
|
|
bestellInfos[1] = adresse;
|
|
bestellInfos[2] = String.valueOf(versandkosten);
|
|
bestellInfos[3] = String.valueOf(anteil7);
|
|
bestellInfos[4] = String.valueOf(anteil19);
|
|
bestellInfos[5] = String.valueOf(gesamtPreis);
|
|
|
|
return bestellInfos;
|
|
}
|
|
|
|
|
|
}
|