backup
This commit is contained in:
107
14/12/Bank.java
Normal file
107
14/12/Bank.java
Normal file
@@ -0,0 +1,107 @@
|
||||
import java.util.Scanner;
|
||||
import java.util.ArrayList;
|
||||
public class Bank {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
showBar();
|
||||
|
||||
Kunde kunde = new Kunde("Meier", 23);
|
||||
// ArrayList<Girokonto> konten = new ArrayList();
|
||||
//
|
||||
// konten.add( new Girokonto(0,1000.0));
|
||||
// konten.add( new Girokonto(1,100430.0));
|
||||
// konten.add( new Girokonto(2,53.3));
|
||||
|
||||
kunde.setKundeKonto(new Girokonto(0,1000.0),0);
|
||||
kunde.setKundeKonto(new Girokonto(1,10340.0),1);
|
||||
kunde.setKundeKonto(new Girokonto(2,15.0),2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
String nl = System.lineSeparator();
|
||||
|
||||
|
||||
boolean end = false;
|
||||
int index = 0;
|
||||
while(!end) {
|
||||
System.out.println("Was wollen Sie?");
|
||||
System.out.println("1. Übersicht \n2. Anzahl\n3. Konto wählen\n0. Beenden");
|
||||
|
||||
System.out.println();
|
||||
System.out.print("Wahl: ");
|
||||
String wahl = input.next();
|
||||
System.out.println();
|
||||
switch (wahl) {
|
||||
case "1":
|
||||
kunde.uebersichtKonten();
|
||||
break;
|
||||
case "2":
|
||||
kunde.anzahlKonten();
|
||||
break;
|
||||
case "3":
|
||||
System.out.println("Wählen Sie Konto!");
|
||||
System.out.print("Index: ");
|
||||
index = input.nextInt();
|
||||
KontoMenu(kunde.getKundeKonto(index));
|
||||
break;
|
||||
case "0":
|
||||
end = true;
|
||||
break;
|
||||
}
|
||||
System.out.println("----------------------------");
|
||||
|
||||
}
|
||||
System.out.println("Auf Wiedersehen!");
|
||||
|
||||
}
|
||||
public static void KontoMenu(Konto konto) {
|
||||
Scanner input = new Scanner(System.in);
|
||||
String nl = System.lineSeparator();
|
||||
|
||||
boolean end = false;
|
||||
double summe = 0;
|
||||
while(!end) {
|
||||
System.out.println("Was wollen Sie?");
|
||||
System.out.println("1. Kontostand anzeigen \n2. Einzahlen\n3. Auszahlen\n0. Beenden");
|
||||
|
||||
System.out.println();
|
||||
System.out.print("Wahl: ");
|
||||
String wahl = input.next();
|
||||
System.out.println();
|
||||
switch (wahl) {
|
||||
case "1":
|
||||
System.out.println("Ihre Kontostand: " + konto.getKontostand() );
|
||||
break;
|
||||
case "2":
|
||||
System.out.println("Einzahlung!");
|
||||
System.out.print("Tragen Sie die Summe: ");
|
||||
summe = input.nextDouble();
|
||||
konto.einzahlen(summe);
|
||||
break;
|
||||
case "3":
|
||||
System.out.println("Auszahlung!");
|
||||
System.out.print("Tragen Sie die Summe: ");
|
||||
summe = input.nextDouble();
|
||||
konto.auszahlen(summe);
|
||||
break;
|
||||
case "0":
|
||||
end = true;
|
||||
break;
|
||||
}
|
||||
showBar();
|
||||
|
||||
}
|
||||
System.out.println("Auf Wiedersehen!");
|
||||
showBar();
|
||||
showBar();
|
||||
showBar();
|
||||
}
|
||||
public static void showBar() {
|
||||
System.out.println("----------------------------");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user