From 77ae9e27f9584e0b5d5837c541f180c09a732324 Mon Sep 17 00:00:00 2001 From: Zabih Mansuri <3010192@stud.hs-mannheim.de> Date: Tue, 22 Oct 2024 18:14:06 +0200 Subject: [PATCH] =?UTF-8?q?alles=20angepasst=20und=20gepr=C3=BCft=20online?= =?UTF-8?q?=20shop=20funktioniert,=20fragen=20ob=20die=20prudukte=20in=20o?= =?UTF-8?q?nlinshop,=20sich=20=C3=A4ndern=20,m=C3=BCssen,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main.java | 9 --------- Onlineshop.java | 9 +++++++++ out/production/Online_schop/Main.class | Bin 2959 -> 2630 bytes 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Main.java b/Main.java index d434b75..027e97b 100644 --- a/Main.java +++ b/Main.java @@ -5,15 +5,6 @@ public class Main { Scanner scanner = new Scanner(System.in); Onlineshop shop = new Onlineshop(); - // Produkte erstellen und zum Shop hinzufügen - Produkt gabel = new Produkt("Gabel", 1, 1.12F, 0.1F, 100); - Produkt messer = new Produkt("Messer", 2, 1.14F, 0.2F, 100); - Produkt loeffel = new Produkt("Löffel", 3, 1.15F, 0.15F, 100); - - shop.produktHinzufuegen(gabel); - shop.produktHinzufuegen(messer); - shop.produktHinzufuegen(loeffel); - // Hauptmenü-Schleife für den Benutzer boolean weiterEinkaufen = true; while (weiterEinkaufen) { diff --git a/Onlineshop.java b/Onlineshop.java index 73e81c0..14e5908 100644 --- a/Onlineshop.java +++ b/Onlineshop.java @@ -5,8 +5,14 @@ public class Onlineshop { private List produkte; // Achte darauf, dass der Typ korrekt ist private Warenkorb warenkorb; private List bestellungen; + private Produkt gabel; + private Produkt messer; + private Produkt loeffel; public Onlineshop() { + this.gabel=new Produkt("Gabel", 1, 1.12F, 0.1F, 100); + this.messer=new Produkt("Messer", 2, 1.14F, 0.2F, 100); + this.loeffel=new Produkt("Löffel", 3, 1.15F, 0.15F, 100); this.produkte = new ArrayList<>(); this.warenkorb = new Warenkorb(); this.bestellungen = new ArrayList<>(); @@ -19,6 +25,9 @@ public class Onlineshop { // API: Produkte zurückgeben (für Anzeige in der UI) public List getProdukte() { + produkte.add(gabel); + produkte.add(loeffel); + produkte.add(messer); return produkte; } diff --git a/out/production/Online_schop/Main.class b/out/production/Online_schop/Main.class index 77fb88e3e69f421d1a5f04f48d59ba9f32e27688..ae8b717b1672c0018949261ab9c66c3292f2e9b2 100644 GIT binary patch delta 1350 zcmX|ATWl0%6#mZc%+6j$uuG?9TDnf}w_z7bFR+wKmtrZl7SV34MP#>~mR_9Vc8hr3 zD&C7C{@yT}XkxO)2NE&ahN8xVga=>r#l#pxj1N5VWJpX5X+6{KGRgm+bN=s~^PlfO zbIzAuFZTbuy7D7{ZhUmX|AXHLKT1@TVyj4#QCCLL;#O+n+V_*mM9MObq~^vKX3|#F zk8P+>5K?g;46#C;o+=g9s1bLlHc*Fp1q~`1(IiY)N5I5(1z{Bt>=3rA-fN;o#V)jp z&t0Jw1?>bSpV&#e+sV0yFK+0cPMl6eW)t>gWH32xjivWC#=Y1p{&KbJ`&4w{evY)Q zGwD7%O>j3f_Ic4QB5uQTKt&G@iXnFs^@>GzIrWLp+-3TMgy7C_frWAHD|_5Z*)u91$)w9VA4uD*drn&b<>bI zA=P?@RXm0fu_TpCql7L|DK(4Vq|)jqR2;{XgnLhIJl{b(J;C={HbH9Wb2uf$X1U5U zreYkH=#Xn@QXG>jJyR;CF(b~(dqPjCurb5+C+}9#eYc2H;t#p3D5YW^9)dhJJ2!7B zSolu%93pX2siJdYN!gZ3!^NEj@9YE*@2A;{uq2jp(=zDWb@&fBcKyR1_W(3}70SqE_?EG`|0;qb%P1a@x+*SG=VfR?J%@5LmqFzf)DohS zE?q%0;UdZ$Z71O;v_)n1)a4vHvTJ`kK~WBB&Y`nia;*IYOExu0W4BnlNArA&fCE0j zpd%0E<>9>S&&!9_Wkw4gVP!q1qAA}n75+Zv65z zAxttN6u=JJgcd47E9q#X5RYyRI>^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