help me lord
This commit is contained in:
parent
fb196693e4
commit
db6b2a2a6e
42 changed files with 342 additions and 0 deletions
7
Code/Steiner/giroKonto/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/giroKonto/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
18
Code/Steiner/giroKonto/README.md
Normal file
18
Code/Steiner/giroKonto/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
## Getting Started
|
||||
|
||||
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
The workspace contains two folders by default, where:
|
||||
|
||||
- `src`: the folder to maintain sources
|
||||
- `lib`: the folder to maintain dependencies
|
||||
|
||||
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||
|
||||
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||
|
||||
## Dependency Management
|
||||
|
||||
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
BIN
Code/Steiner/giroKonto/bin/App.class
Normal file
BIN
Code/Steiner/giroKonto/bin/App.class
Normal file
Binary file not shown.
BIN
Code/Steiner/giroKonto/bin/Konto.class
Normal file
BIN
Code/Steiner/giroKonto/bin/Konto.class
Normal file
Binary file not shown.
BIN
Code/Steiner/giroKonto/src/App.class
Normal file
BIN
Code/Steiner/giroKonto/src/App.class
Normal file
Binary file not shown.
16
Code/Steiner/giroKonto/src/App.java
Normal file
16
Code/Steiner/giroKonto/src/App.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Aufgabe 1
|
||||
System.out.println("Aufgabe 1: \n");
|
||||
|
||||
Konto konto1 = new Konto("0000000001", 1000);
|
||||
System.out.println(konto1.toString());
|
||||
konto1.einzahlen(500);
|
||||
konto1.abheben(750);
|
||||
System.out.println("\nDaten nach transaktionen: ");
|
||||
System.out.println(konto1.toString());
|
||||
|
||||
// Aufgabe 2
|
||||
System.out.println("Aufgabe 2");
|
||||
}
|
||||
}
|
BIN
Code/Steiner/giroKonto/src/Konto.class
Normal file
BIN
Code/Steiner/giroKonto/src/Konto.class
Normal file
Binary file not shown.
40
Code/Steiner/giroKonto/src/Konto.java
Normal file
40
Code/Steiner/giroKonto/src/Konto.java
Normal file
|
@ -0,0 +1,40 @@
|
|||
public class Konto {
|
||||
private String kontonummer;
|
||||
private double kontostand;
|
||||
|
||||
public Konto(String kontonummer, int kontostand) {
|
||||
if (kontonummer.length() == 10) {
|
||||
this.kontonummer = kontonummer;
|
||||
this.kontostand = kontostand;
|
||||
} else
|
||||
System.out.println("Es ist fehler beim erstellen des Konto aufgetreten");
|
||||
}
|
||||
|
||||
public String getKontonummer() {
|
||||
return kontonummer;
|
||||
}
|
||||
|
||||
public double getKontostand() {
|
||||
return kontostand;
|
||||
}
|
||||
|
||||
public void abheben(double betrag) {
|
||||
if (kontostand >= 0) {
|
||||
this.kontostand -= betrag;
|
||||
} else
|
||||
System.out.println("Fehlermeldung #1225");
|
||||
}
|
||||
|
||||
public void einzahlen(double betrag) {
|
||||
if (kontostand >= 0) {
|
||||
this.kontostand += betrag;
|
||||
} else
|
||||
System.out.println("Fehlermeldung #5221");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Konto [Kontonummer=" + kontonummer + ", Kontostand=" + kontostand + "CHF]";
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue