diff --git a/OOP Bankkonto/.vscode/settings.json b/OOP Bankkonto/.vscode/settings.json new file mode 100644 index 0000000..0ac215c --- /dev/null +++ b/OOP Bankkonto/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/OOP Bankkonto/README.md b/OOP Bankkonto/README.md new file mode 100644 index 0000000..a43b9f6 --- /dev/null +++ b/OOP Bankkonto/README.md @@ -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). diff --git a/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/Account.class b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/Account.class new file mode 100644 index 0000000..3e05d2b Binary files /dev/null and b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/Account.class differ diff --git a/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/App.class b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/App.class new file mode 100644 index 0000000..759cbeb Binary files /dev/null and b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/App.class differ diff --git a/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/LimitedAccount.class b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/LimitedAccount.class new file mode 100644 index 0000000..a3a3fae Binary files /dev/null and b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/LimitedAccount.class differ diff --git a/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/PrepaidAccunt.class b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/PrepaidAccunt.class new file mode 100644 index 0000000..a0ae458 Binary files /dev/null and b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/PrepaidAccunt.class differ diff --git a/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/UnlimitedAccount.class b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/UnlimitedAccount.class new file mode 100644 index 0000000..b47b600 Binary files /dev/null and b/OOP Bankkonto/bin/main/pr2/exercise/e01_banking/UnlimitedAccount.class differ diff --git a/OOP Bankkonto/src/main/pr2/exercise/e01_banking/Account.java b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/Account.java new file mode 100644 index 0000000..f43c33a --- /dev/null +++ b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/Account.java @@ -0,0 +1,55 @@ +package main.pr2.exercise.e01_banking; +/** This class represents a model for banking accounts. +* Other possible accounts can be extended +* @author Armin Omanovic +* @author Christian Hauff +* @version 1.0 +* +*/ + +public class Account { + + private double kontostand = 0; + + +/** This method returns the current account balance +* +* @return the account balance +*/ + public double getBalance(){ + System.out.println("Ihr Kontostand betrÃĪgt: " + kontostand); + return kontostand; + } + +/** This method deposits the specified amount. + * The amount needs to be greater than 0. + * @param amount the int you deposit + * @return the account balance after the deposit + * + */ + public double deposit(int amount){ + if(amount <= 0){ + System.out.println("Der Betrag kann nicht 0 oder kleiner betragen!"); + return kontostand; + }else{ + kontostand += amount; + return kontostand; + } + } + +/** This method withdraws the specified amount. + * The amount has to be greater than 0. + * +* @param amount the int you withdraw +* @return the account balance after the withdrawal +*/ + public double withdraw(int amount){ + if(amount <= 0){ + System.out.println("Der Betrag kann nicht 0 oder kleiner betragen!"); + return kontostand; + }else{ + kontostand -= amount; + return kontostand; + } + } +} diff --git a/OOP Bankkonto/src/main/pr2/exercise/e01_banking/App.java b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/App.java new file mode 100644 index 0000000..c155b48 --- /dev/null +++ b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/App.java @@ -0,0 +1,8 @@ +package main.pr2.exercise.e01_banking; + +public class App { + public static void main(String[] args) throws Exception { + + //Bankkonto Aufgabe + } +} diff --git a/OOP Bankkonto/src/main/pr2/exercise/e01_banking/LimitedAccount.java b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/LimitedAccount.java new file mode 100644 index 0000000..94ff517 --- /dev/null +++ b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/LimitedAccount.java @@ -0,0 +1,7 @@ +package main.pr2.exercise.e01_banking; + +public class LimitedAccount extends Account{ + + + +} diff --git a/OOP Bankkonto/src/main/pr2/exercise/e01_banking/PrepaidAccunt.java b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/PrepaidAccunt.java new file mode 100644 index 0000000..f7e690f --- /dev/null +++ b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/PrepaidAccunt.java @@ -0,0 +1,5 @@ +package main.pr2.exercise.e01_banking; + +public class PrepaidAccunt extends Account { + +} diff --git a/OOP Bankkonto/src/main/pr2/exercise/e01_banking/UnlimitedAccount.java b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/UnlimitedAccount.java new file mode 100644 index 0000000..1fc6b5c --- /dev/null +++ b/OOP Bankkonto/src/main/pr2/exercise/e01_banking/UnlimitedAccount.java @@ -0,0 +1,5 @@ +package main.pr2.exercise.e01_banking; + +public class UnlimitedAccount extends Account { + +}