From 192ee4b3b15c8677de919d956f0372725dbce44e Mon Sep 17 00:00:00 2001 From: Obai Albek Date: Fri, 9 May 2025 21:27:09 +0000 Subject: [PATCH] OOP --- .devcontainer/devcontainer.json | 44 ++-- .gitignore | 362 ++++++++++++++-------------- 06-OOP-Bankensystem/Bankensystem.js | 58 +++++ 06-OOP-Bankensystem/Bankesystem.htm | 13 + 06-OOP-Bankensystem/README.md | 32 +++ README.md | 4 +- 6 files changed, 308 insertions(+), 205 deletions(-) create mode 100644 06-OOP-Bankensystem/Bankensystem.js create mode 100644 06-OOP-Bankensystem/Bankesystem.htm create mode 100644 06-OOP-Bankensystem/README.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b332f39..7b185a1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,22 +1,22 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu -{ - "name": "Ubuntu", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:jammy" - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "uname -a", - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "Ubuntu", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:jammy" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.gitignore b/.gitignore index 5ece98e..3e29e04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,181 +1,181 @@ -# ---> Java -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* - -# ---> 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 - -# ---> VisualStudioCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -# ---> JetBrains -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +# ---> 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 + +# ---> VisualStudioCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +# ---> JetBrains +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + diff --git a/06-OOP-Bankensystem/Bankensystem.js b/06-OOP-Bankensystem/Bankensystem.js new file mode 100644 index 0000000..10e3307 --- /dev/null +++ b/06-OOP-Bankensystem/Bankensystem.js @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +class Main{ + + static main(){ + + /* + // Konten erstellen + const studentKonto = new Konto(); + const firmaKonto = new Konto(); + + // Einzahlungen + studentKonto.einzahlen(500); + firmaKonto.einzahlen(10000); + + // Objekte erstellen + const student = new Student("Frank", "Muster", "123456", "Informatik", studentKonto); + const firma = new Geschaeftskunde("Max", "Muster", "Tech Solutions GmbH", firmaKonto); + + // Ausgaben + console.log(student.toString()); + console.log("Kontostand: " + student.getKontostand() + " €"); + + console.log(firma.toString()); + console.log("Kontostand: " + firma.getKontostand() + " €"); + */ + } +} + +Main.main(); \ No newline at end of file diff --git a/06-OOP-Bankensystem/Bankesystem.htm b/06-OOP-Bankensystem/Bankesystem.htm new file mode 100644 index 0000000..39e43a7 --- /dev/null +++ b/06-OOP-Bankensystem/Bankesystem.htm @@ -0,0 +1,13 @@ + + + + + + Document + + + + + + + \ No newline at end of file diff --git a/06-OOP-Bankensystem/README.md b/06-OOP-Bankensystem/README.md new file mode 100644 index 0000000..66189c2 --- /dev/null +++ b/06-OOP-Bankensystem/README.md @@ -0,0 +1,32 @@ +# 🏦 OOP-Bankensystem (JavaScript) + +## Aufgabe +In diesem Projekt soll ein kleines objektorientiertes Bankensystem mit JavaScript umgesetzt werden. Die Aufgabe dient als Übung zur Anwendung der OOP-Konzepte **Klassen**, **Vererbung**, **Kapselung** und **Polymorphismus**. + +## Ziel +Implementiere folgende Klassen: +- `Kunde` (Basisklasse) +- `Student` (erbt von `Kunde`) +- `Geschaeftskunde` (erbt von `Kunde`) +- `Konto` (eigenständige Klasse zur Verwaltung des Kontostands) + +## Hinweise zur Implementierung + +### Klasse `Konto` +- Attribut: `#kontostand` +- Methoden: `einzahlen(betrag)`, `auszahlen(betrag)`, `getKontostand()` + +### Klasse `Kunde` +- Attribute: `#vorname`, `#nachname`, `#konto` +- Methoden: `toString()` + +### Klasse `Student` +- Zusätzliche Attribute: `#matrikelnummer`, `#studiengang` +- Methode: überschreibt `toString()` + +### Klasse `Geschaeftskunde` +- Zusätzliche Attribut: `#firma` +- Methode: überschreibt `toString()` + +## Testen +Nach erfolgreicher Implementierung könnt ihr den Code in der `Main`-Klasse **auskommentieren**, um eure Klassen zu testen. diff --git a/README.md b/README.md index aec0f44..793defa 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# js-praesentation-devcontainer - +# js-praesentation-devcontainer +