Compare commits
No commits in common. "a4f0a1853ecd2e121321a06ac29d7c00bd0f8ba7" and "3d37013ac8aa750745a34018c1685901a0b78c11" have entirely different histories.
a4f0a1853e
...
3d37013ac8
|
@ -1,32 +1,10 @@
|
|||
import java.util.Date;
|
||||
public class Parkhaus {
|
||||
private double maxNachtPreis;
|
||||
|
||||
private double preis;
|
||||
private double maxTagesPreis;
|
||||
private int maxParkPlatz;
|
||||
private Auto[] parkendeAutos;
|
||||
private int anzahlParkendeAutos;
|
||||
|
||||
public double getMaxNachtPreis() {
|
||||
return maxNachtPreis;
|
||||
}
|
||||
|
||||
public double getMaxTagesPreis() {
|
||||
return maxTagesPreis;
|
||||
}
|
||||
|
||||
public int getMaxParkPlatz() {
|
||||
return maxParkPlatz;
|
||||
}
|
||||
|
||||
public Parkhaus(double preis){
|
||||
this.preis = 1.0;
|
||||
this.maxNachtPreis = 5;
|
||||
this.maxTagesPreis = 15;
|
||||
this.maxParkPlatz = 100;
|
||||
this.parkendeAutos = new Auto[maxParkPlatz];
|
||||
this.anzahlParkendeAutos = 0;
|
||||
}
|
||||
this.preis = preis;}
|
||||
|
||||
public double getPreis() {return preis;}
|
||||
|
||||
|
@ -34,29 +12,8 @@ public class Parkhaus {
|
|||
this.preis = preis;
|
||||
}
|
||||
|
||||
public double berechneParkKosten (Auto auto){
|
||||
int einFahrtStunde = auto.getEinfahrtZeit().getHours();
|
||||
int ausFahrtStunde = auto.getAusfahrtZeit().getHours();
|
||||
public double berechneParkDauer (Auto auto){
|
||||
|
||||
long parkDauerMinuten = (auto.getBezahlZeit().getTime()-auto.getEinfahrtZeit().getTime());
|
||||
|
||||
if (einFahrtStunde >= 20 && ausFahrtStunde <= 06){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (parkDauerMinuten <= 15){
|
||||
return 0;
|
||||
}
|
||||
parkDauerMinuten -= 15;
|
||||
long parkDauerStunden = (parkDauerMinuten/60)+1;
|
||||
double kosten = parkDauerStunden*preis;
|
||||
|
||||
if (auto.getEAuto() == true){
|
||||
kosten*=0.8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue