Parkhaus grober Aufbau hinzugefügt
parent
a2120734eb
commit
e722310a11
|
@ -0,0 +1,26 @@
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class Auto {
|
||||||
|
|
||||||
|
private String kennzeichen;
|
||||||
|
private Date einfahrtZeit;
|
||||||
|
private Date bezahlZeit;
|
||||||
|
private Date ausfahrtZeit;
|
||||||
|
private boolean bezahlt;
|
||||||
|
|
||||||
|
public Auto(String kennzeichen, Date einfahrtZeit, Date bezahlZeit, Date ausfahrtZeit, boolean bezahlt) {
|
||||||
|
this.kennzeichen = kennzeichen;
|
||||||
|
this.einfahrtZeit = einfahrtZeit;
|
||||||
|
this.bezahlZeit = bezahlZeit;
|
||||||
|
this.ausfahrtZeit = ausfahrtZeit;
|
||||||
|
this.bezahlt = bezahlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKennzeichen() {return kennzeichen;}
|
||||||
|
public Date getEinfahrtZeit() {return einfahrtZeit;}
|
||||||
|
public Date getBezahlZeit() {return bezahlZeit;}
|
||||||
|
public Date getAusfahrtZeit() {return ausfahrtZeit;}
|
||||||
|
public boolean getBezahlt() {return bezahlt;}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
public class Main {
|
||||||
|
}
|
|
@ -1,5 +1,26 @@
|
||||||
public class Parkhaus {
|
import java.util.Date;
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
|
public class Parkhaus {
|
||||||
|
private int freieParkplatz;
|
||||||
|
private double preis;
|
||||||
|
private Date opening;
|
||||||
|
private Date closing;
|
||||||
|
|
||||||
|
public Parkhaus(int freieParkplatz,double preis, Date opening, Date closing){
|
||||||
|
this.freieParkplatz = freieParkplatz;
|
||||||
|
this.preis = preis;
|
||||||
|
this.opening = opening;
|
||||||
|
this.closing = closing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getFreieParkplatz() {return freieParkplatz;}
|
||||||
|
public double getPreis() {return preis;}
|
||||||
|
public Date getOpening() {return opening;}
|
||||||
|
public Date getClosing() {return closing;}
|
||||||
|
|
||||||
|
|
||||||
|
public double parkKosten = ((Auto.getEinfahrtZeit() - Auto.getBezahlZeit())*preis);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue