commit cd545041d83fb986fa9eeb43a9d886aaad1b6cb1 Author: gevorgmargaryan Date: Mon Apr 8 10:08:57 2024 +0200 Erster Push diff --git a/PR2(UIB)/.classpath b/PR2(UIB)/.classpath new file mode 100644 index 0000000..57bca72 --- /dev/null +++ b/PR2(UIB)/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/PR2(UIB)/.gitignore b/PR2(UIB)/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/PR2(UIB)/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/PR2(UIB)/.project b/PR2(UIB)/.project new file mode 100644 index 0000000..b0f72a5 --- /dev/null +++ b/PR2(UIB)/.project @@ -0,0 +1,17 @@ + + + PR2(UIB) + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/PR2(UIB)/.settings/org.eclipse.core.resources.prefs b/PR2(UIB)/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/PR2(UIB)/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/PR2(UIB)/.settings/org.eclipse.jdt.core.prefs b/PR2(UIB)/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/PR2(UIB)/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/PR2(UIB)/src/verwaltung/kunde/Adress.java b/PR2(UIB)/src/verwaltung/kunde/Adress.java new file mode 100644 index 0000000..b377266 --- /dev/null +++ b/PR2(UIB)/src/verwaltung/kunde/Adress.java @@ -0,0 +1,47 @@ +package verwaltung.kunde; + +public class Adress { + + private String name; + private String straße; + private int PLZ; + private String wohnort; + + public Adress(String name, String straße, int PLZ, String wohnort) { + this.name = name; + this.straße = straße; + this.PLZ = PLZ; + this.wohnort = wohnort; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getStraße() { + return straße; + } + public void setStraße(String straße) { + straße = straße; + } + public int getPLZ() { + return PLZ; + } + public void setPLZ(int pLZ) { + PLZ = pLZ; + } + public String getWohnort() { + return wohnort; + } + public void setWohnort(String wohnort) { + wohnort = wohnort; + } + + + public String toString() { + String output = "Name des Kunden; " + this.name + " Straße: " + this.straße + " PLZ: " + this.PLZ + " Wohnort: " + this.wohnort; + return output; + } +} diff --git a/PR2(UIB)/src/verwaltung/kunde/GescheaftsKunde.java b/PR2(UIB)/src/verwaltung/kunde/GescheaftsKunde.java new file mode 100644 index 0000000..4cf44f9 --- /dev/null +++ b/PR2(UIB)/src/verwaltung/kunde/GescheaftsKunde.java @@ -0,0 +1,5 @@ +package verwaltung.kunde; + +public class GescheaftsKunde { + +} diff --git a/PR2(UIB)/src/verwaltung/kunde/Kunde.java b/PR2(UIB)/src/verwaltung/kunde/Kunde.java new file mode 100644 index 0000000..9e0bde3 --- /dev/null +++ b/PR2(UIB)/src/verwaltung/kunde/Kunde.java @@ -0,0 +1,43 @@ +package verwaltung.kunde; + +public class Kunde { + + private String vorname, nachname; + protected static int lastUsedId; + private int kundenId; + private Adress adress; + + public Kunde(String vorname, String nachname) { + kundenId = lastUsedId; + lastUsedId++; + + this.vorname = vorname; + this.nachname = nachname; + } + + + public Adress getAdress() { + return adress; + } + + public void setAdress(Adress adress) { + this.adress = adress; + } + + public Kunde(Adress adress) { + this.adress = adress; + } + + public String toString() { + String output = "Kundenadresse: " + this.adress; + return output; + } + + public static void main(String[] args) { + + Adress adress = new Adress("Max","Q2",68161,"Mannheim"); + Kunde kunde = new Kunde(adress); + + System.out.println(kunde.toString()); + } +} \ No newline at end of file diff --git a/PR2(UIB)/src/verwaltung/kunde/PrivateKunde.java b/PR2(UIB)/src/verwaltung/kunde/PrivateKunde.java new file mode 100644 index 0000000..713e45b --- /dev/null +++ b/PR2(UIB)/src/verwaltung/kunde/PrivateKunde.java @@ -0,0 +1,33 @@ +package verwaltung.kunde; + +public class PrivateKunde extends Kunde{ + + private String telefone, email; + private String berater; + + public PrivateKunde(String vorname, String nachname, String telefon, String email) { + super(vorname, nachname); + + this.telefone = telefone; + this.email = email; + this.berater = null; + } + + /** + * Diese Methode setzt einen Berater einesx PrivateKunden + * @param berater + * @param overwrite + * @return + */ + + public boolean setBerater(String berater, boolean overwrite) { + if(this.berater != null || overwrite) { + this.berater = berater; + + return true; + } + + return false; + } + +}