Compare commits
No commits in common. "master" and "main" have entirely different histories.
10
.classpath
10
.classpath
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -1 +1,64 @@
|
|||
/bin/
|
||||
# ---> Eclipse
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
.apt_generated_test/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
# Uncomment this line if you wish to ignore the project description file.
|
||||
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||
#.project
|
||||
|
||||
Projekt-PR1/
|
||||
eclipse.exe
|
17
.project
17
.project
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Projekt_PR1</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
|
@ -1,12 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
137
src/Konto.java
137
src/Konto.java
|
@ -1,137 +0,0 @@
|
|||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Konto {
|
||||
public static Scanner scanner = new Scanner(System.in);
|
||||
//private static ATM atm = new ATM();
|
||||
public static HashMap<Integer, Double> konto = new HashMap<>();
|
||||
|
||||
public static HashMap <Integer, String> nameList= new HashMap <> ();
|
||||
|
||||
public static void getArray(String filename) throws FileNotFoundException {
|
||||
|
||||
ArrayList <String> arrayList=new ArrayList <>();
|
||||
Scanner scanner = new Scanner (new File (filename));
|
||||
|
||||
while (scanner.hasNext())
|
||||
{
|
||||
arrayList.add(scanner.nextLine());
|
||||
|
||||
for (String line : arrayList) {
|
||||
String [] items = line.split(";");
|
||||
int kontonummer= Integer.parseInt(items[0]);
|
||||
Double kontostand= Double.parseDouble(items[1]);
|
||||
|
||||
String vorname=items[2] ;
|
||||
String nachname = items[3];
|
||||
|
||||
konto.put(kontonummer,kontostand);
|
||||
nameList.put(kontonummer,nachname);
|
||||
}
|
||||
}}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
Konto.getArray("src/Konto.txt");
|
||||
System.out.println("Herzlich willkommen! \nbeim Private Banking Ihrer .... \n");
|
||||
System.out.println("Bitte geben Sie Ihre Kontonummer ein :");
|
||||
|
||||
while (true) {
|
||||
int kontonummer = scanner.nextInt();
|
||||
|
||||
if (!konto.containsKey(kontonummer)) {
|
||||
System.out.println("Sie haben keine Konto.\n Wollen Sie ein neues Konto eröffnen? [ja/nein]");
|
||||
Scanner scanner_a = new Scanner(System.in);
|
||||
String neuesKonto = scanner_a.nextLine();
|
||||
|
||||
if (neuesKonto.equalsIgnoreCase("ja")) {
|
||||
konto.put(kontonummer, 0.00);
|
||||
System.out.println("Ihre Konto wurde erstellt " +
|
||||
"Ihre Kontostand ist " + konto.get(kontonummer)+" €"); }
|
||||
else {
|
||||
System.out.println("Vielen Dank fuer Ihren Besuch!");
|
||||
continue; }
|
||||
} else {
|
||||
System.out.println("Hallo Frau/Herr " + nameList.get(kontonummer) + "!");}
|
||||
|
||||
int count = 1;
|
||||
while (count == 1) {
|
||||
double kontostand = konto.get(kontonummer);
|
||||
System.out.println("\n=== Bank Hauptmenue ===");
|
||||
System.out.println("\nBitte waehlen Sie einen Menuepunkt!\n" +
|
||||
"1. Kontostand\n" +
|
||||
"2. Geld abheben\n" +
|
||||
"3. Geld einzahlen\n" +
|
||||
"4. Geld überweisen\n" +
|
||||
"5. Konto kündigen\n" +
|
||||
"6. Beenden Menue");
|
||||
|
||||
int menue = scanner.nextInt();
|
||||
switch (menue) {
|
||||
case 1:
|
||||
System.out.println("Ihr aktueller Kontostand ist " + kontostand+" €");
|
||||
break;
|
||||
case 2:
|
||||
System.out.println("Wie viel Geld möchten Sie abheben?");
|
||||
int abheben = scanner.nextInt();
|
||||
if (abheben > kontostand) {
|
||||
System.out.println("Sie haben nicht genügend Guthaben auf Ihrem Konto");
|
||||
break;
|
||||
} else if (abheben % 5 != 0) {
|
||||
System.out.println("Bitte geben Sie ein Vielfaches von 5 €, 10 € oder 20 € ein");
|
||||
break;
|
||||
} else {
|
||||
System.out.println("Bitte heben Sie " + abheben+" ab");
|
||||
konto.put(kontonummer, konto.get(kontonummer) - abheben);
|
||||
System.out.println("Ihr aktueller Kontostand ist " + (kontostand - abheben)+" €");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
System.out.println("Wie viel Gelde möchten Sie einzahlen?");
|
||||
int einzahlen = scanner.nextInt();
|
||||
|
||||
System.out.println("Auf Ihr Konto wurde " + einzahlen+" € eingezahlt.");
|
||||
System.out.println("Ihr aktueller Kontostand ist " + (kontostand + einzahlen)+" €");
|
||||
konto.put(kontonummer, konto.get(kontonummer) + einzahlen);
|
||||
break;
|
||||
case 4:
|
||||
scanner.nextLine();
|
||||
System.out.println("Geben Sie den Kontonummer ein, auf den Sie Geld überweisen möchten.");
|
||||
int kontoNüber = scanner.nextInt();
|
||||
|
||||
System.out.println("Geben Sie den Betrag ein, den Sie überweisen möchten.");
|
||||
double betragÜber = scanner.nextInt();
|
||||
|
||||
konto.put(kontonummer, konto.get(kontonummer) - betragÜber);
|
||||
konto.put(kontoNüber, konto.get(kontoNüber) + betragÜber);
|
||||
|
||||
System.out.println("Ihr aktueller Kontostand ist " + konto.get(kontonummer));
|
||||
break;
|
||||
case 5:
|
||||
System.out.println("Sind Sie sicher, dass Sie Ihr Konto löschen möchten? [ja/nein]?");
|
||||
scanner.nextLine();
|
||||
String abbrechen = scanner.nextLine();
|
||||
|
||||
if (abbrechen.equalsIgnoreCase("ja")) {
|
||||
konto.remove(kontonummer);
|
||||
System.out.println("Wir bedauern Sie gehen zu sehen.");
|
||||
count = 0;
|
||||
} else {
|
||||
System.out.println("Wir möchten uns bei Ihnen herzlich bedanken.");
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
System.out.println("Vielen Dank fuer Ihren Besuch!");
|
||||
count = 0;
|
||||
scanner.nextLine();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
1234;1000;Hellana; Wahnsinn
|
||||
1235;1111;Rainer; Zufall;
|
||||
1236;300;Anna; Bolika;
|
||||
1237;400;Axel; Schweiss;
|
||||
1238;605;Klara; Fall;
|
||||
1239;706;Ali; Gator;
|
||||
1240;173;Bob; Fahren;
|
||||
1241;756;Ellen; Bogen;
|
||||
1242;236;Eva; Kuierung;
|
Loading…
Reference in New Issue