diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/Online Shop.iml b/.idea/Online Shop.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/Online Shop.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/cat-activity.xml b/.idea/cat-activity.xml new file mode 100644 index 0000000..2159a10 --- /dev/null +++ b/.idea/cat-activity.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..8016ee3 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..df19591 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..188022c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5770f22 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Shop/src/main/java/backend/pack/OnlineShop.java b/Shop/src/main/java/backend/pack/OnlineShop.java index 230fe6b..c6713a5 100644 --- a/Shop/src/main/java/backend/pack/OnlineShop.java +++ b/Shop/src/main/java/backend/pack/OnlineShop.java @@ -5,63 +5,57 @@ import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; + + public class OnlineShop { private static ArrayList LagerList; public static void Start() throws FileNotFoundException { LagerList=readFile(); - new OnlineShop(LagerList); + } - public OnlineShop(ArrayList Lagerlist) throws FileNotFoundException { - String [][] produkt= produktListe(Lagerlist); - IO.print(""); - for(int j=0;j erstelleListe(String[][] produktArray) { + ArrayList ProduktListe= new ArrayList<>(); + for(int i=1;i readFile() throws FileNotFoundException { - Scanner sc = new Scanner(new File("Shop/resources/produkte.csv")); + Scanner sc = new Scanner(new File("Shop/resources/produkte.csv")); //Vom Sudoku übernommen ArrayList LagerList = new ArrayList<>(); while (sc.hasNextLine()) { LagerList.add(sc.nextLine()); diff --git a/Shop/src/main/java/backend/pack/Produkt.java b/Shop/src/main/java/backend/pack/Produkt.java index 6bee2f7..10b93dd 100644 --- a/Shop/src/main/java/backend/pack/Produkt.java +++ b/Shop/src/main/java/backend/pack/Produkt.java @@ -4,11 +4,19 @@ public class Produkt { String name; double preis; double mwst; + int ID; + double Gewicht; + int Bestand; - public Produkt(String name, double preis,double mwst) { + + + public Produkt(int ID,String name, double Gewicht, double preis,double mwst, int Bestand) { this.name = name; this.preis = preis; this.mwst= mwst; + this.Gewicht=Gewicht; + this.Bestand=Bestand; + this.ID=ID; } public String toString() { @@ -17,6 +25,9 @@ public class Produkt { public double berechneMwst(){ return Math.round((this.preis-(this.preis/(1+this.mwst/100)))*100.0)/100.0; } + public double berechneBrutto(){ + return preis-berechneMwst(); + } public boolean equals(Object o) { if (!(o instanceof Produkt)) diff --git a/Shop/src/main/java/tui/pack/ShopTUI.java b/Shop/src/main/java/tui/pack/ShopTUI.java index ad3caf7..885b5d5 100644 --- a/Shop/src/main/java/tui/pack/ShopTUI.java +++ b/Shop/src/main/java/tui/pack/ShopTUI.java @@ -22,8 +22,6 @@ public class ShopTUI { } public static boolean hauptmenü() throws FileNotFoundException { - Scanner sc = new Scanner(System.in); - String eingabe = sc.nextLine(); // TODO: hier ein erstes Menü mit bspw. IO.println(" << H a u p t m e n ü >> "); IO.println("1.Produktangebot"); @@ -31,6 +29,8 @@ public class ShopTUI { IO.println("3.Mein Warenkorb"); IO.println("4. Bestellungen"); IO.println("5. Exit "); + Scanner sc = new Scanner(System.in); + String eingabe = sc.nextLine(); if(eingabe.equalsIgnoreCase("Produktangebot") || eingabe.equalsIgnoreCase("1")) produktangebot(); else if (eingabe.equalsIgnoreCase("Produktsuche")|| eingabe.equalsIgnoreCase("2")){ diff --git a/lib/apiguardian-api-1.1.2-javadoc.jar b/lib/apiguardian-api-1.1.2-javadoc.jar new file mode 100644 index 0000000..1199ec8 Binary files /dev/null and b/lib/apiguardian-api-1.1.2-javadoc.jar differ diff --git a/lib/apiguardian-api-1.1.2-sources.jar b/lib/apiguardian-api-1.1.2-sources.jar new file mode 100644 index 0000000..d670ed9 Binary files /dev/null and b/lib/apiguardian-api-1.1.2-sources.jar differ diff --git a/lib/apiguardian-api-1.1.2.jar b/lib/apiguardian-api-1.1.2.jar new file mode 100644 index 0000000..2b678e1 Binary files /dev/null and b/lib/apiguardian-api-1.1.2.jar differ diff --git a/lib/jspecify-1.0.0-javadoc.jar b/lib/jspecify-1.0.0-javadoc.jar new file mode 100644 index 0000000..3fdb187 Binary files /dev/null and b/lib/jspecify-1.0.0-javadoc.jar differ diff --git a/lib/jspecify-1.0.0-sources.jar b/lib/jspecify-1.0.0-sources.jar new file mode 100644 index 0000000..335fef8 Binary files /dev/null and b/lib/jspecify-1.0.0-sources.jar differ diff --git a/lib/jspecify-1.0.0.jar b/lib/jspecify-1.0.0.jar new file mode 100644 index 0000000..466b875 Binary files /dev/null and b/lib/jspecify-1.0.0.jar differ diff --git a/lib/junit-jupiter-6.0.0-javadoc.jar b/lib/junit-jupiter-6.0.0-javadoc.jar new file mode 100644 index 0000000..6f4f771 Binary files /dev/null and b/lib/junit-jupiter-6.0.0-javadoc.jar differ diff --git a/lib/junit-jupiter-6.0.0-sources.jar b/lib/junit-jupiter-6.0.0-sources.jar new file mode 100644 index 0000000..a77fe7d Binary files /dev/null and b/lib/junit-jupiter-6.0.0-sources.jar differ diff --git a/lib/junit-jupiter-6.0.0.jar b/lib/junit-jupiter-6.0.0.jar new file mode 100644 index 0000000..957f029 Binary files /dev/null and b/lib/junit-jupiter-6.0.0.jar differ diff --git a/lib/junit-jupiter-api-6.0.0-javadoc.jar b/lib/junit-jupiter-api-6.0.0-javadoc.jar new file mode 100644 index 0000000..823d58b Binary files /dev/null and b/lib/junit-jupiter-api-6.0.0-javadoc.jar differ diff --git a/lib/junit-jupiter-api-6.0.0-sources.jar b/lib/junit-jupiter-api-6.0.0-sources.jar new file mode 100644 index 0000000..c1f6c8f Binary files /dev/null and b/lib/junit-jupiter-api-6.0.0-sources.jar differ diff --git a/lib/junit-jupiter-api-6.0.0.jar b/lib/junit-jupiter-api-6.0.0.jar new file mode 100644 index 0000000..960579c Binary files /dev/null and b/lib/junit-jupiter-api-6.0.0.jar differ diff --git a/lib/junit-jupiter-engine-6.0.0-javadoc.jar b/lib/junit-jupiter-engine-6.0.0-javadoc.jar new file mode 100644 index 0000000..b6ea700 Binary files /dev/null and b/lib/junit-jupiter-engine-6.0.0-javadoc.jar differ diff --git a/lib/junit-jupiter-engine-6.0.0-sources.jar b/lib/junit-jupiter-engine-6.0.0-sources.jar new file mode 100644 index 0000000..916dbb4 Binary files /dev/null and b/lib/junit-jupiter-engine-6.0.0-sources.jar differ diff --git a/lib/junit-jupiter-engine-6.0.0.jar b/lib/junit-jupiter-engine-6.0.0.jar new file mode 100644 index 0000000..e4fa04a Binary files /dev/null and b/lib/junit-jupiter-engine-6.0.0.jar differ diff --git a/lib/junit-jupiter-params-6.0.0-javadoc.jar b/lib/junit-jupiter-params-6.0.0-javadoc.jar new file mode 100644 index 0000000..274617d Binary files /dev/null and b/lib/junit-jupiter-params-6.0.0-javadoc.jar differ diff --git a/lib/junit-jupiter-params-6.0.0-sources.jar b/lib/junit-jupiter-params-6.0.0-sources.jar new file mode 100644 index 0000000..eb0d0e8 Binary files /dev/null and b/lib/junit-jupiter-params-6.0.0-sources.jar differ diff --git a/lib/junit-jupiter-params-6.0.0.jar b/lib/junit-jupiter-params-6.0.0.jar new file mode 100644 index 0000000..cb89f8c Binary files /dev/null and b/lib/junit-jupiter-params-6.0.0.jar differ diff --git a/lib/junit-platform-commons-6.0.0-javadoc.jar b/lib/junit-platform-commons-6.0.0-javadoc.jar new file mode 100644 index 0000000..f530b9b Binary files /dev/null and b/lib/junit-platform-commons-6.0.0-javadoc.jar differ diff --git a/lib/junit-platform-commons-6.0.0-sources.jar b/lib/junit-platform-commons-6.0.0-sources.jar new file mode 100644 index 0000000..5676cc5 Binary files /dev/null and b/lib/junit-platform-commons-6.0.0-sources.jar differ diff --git a/lib/junit-platform-commons-6.0.0.jar b/lib/junit-platform-commons-6.0.0.jar new file mode 100644 index 0000000..ee13461 Binary files /dev/null and b/lib/junit-platform-commons-6.0.0.jar differ diff --git a/lib/junit-platform-engine-6.0.0-javadoc.jar b/lib/junit-platform-engine-6.0.0-javadoc.jar new file mode 100644 index 0000000..7ab0ba4 Binary files /dev/null and b/lib/junit-platform-engine-6.0.0-javadoc.jar differ diff --git a/lib/junit-platform-engine-6.0.0-sources.jar b/lib/junit-platform-engine-6.0.0-sources.jar new file mode 100644 index 0000000..2368b74 Binary files /dev/null and b/lib/junit-platform-engine-6.0.0-sources.jar differ diff --git a/lib/junit-platform-engine-6.0.0.jar b/lib/junit-platform-engine-6.0.0.jar new file mode 100644 index 0000000..5ae38a2 Binary files /dev/null and b/lib/junit-platform-engine-6.0.0.jar differ diff --git a/lib/opentest4j-1.3.0-javadoc.jar b/lib/opentest4j-1.3.0-javadoc.jar new file mode 100644 index 0000000..b2e7938 Binary files /dev/null and b/lib/opentest4j-1.3.0-javadoc.jar differ diff --git a/lib/opentest4j-1.3.0-sources.jar b/lib/opentest4j-1.3.0-sources.jar new file mode 100644 index 0000000..4570645 Binary files /dev/null and b/lib/opentest4j-1.3.0-sources.jar differ diff --git a/lib/opentest4j-1.3.0.jar b/lib/opentest4j-1.3.0.jar new file mode 100644 index 0000000..7ec7bc5 Binary files /dev/null and b/lib/opentest4j-1.3.0.jar differ diff --git a/out/production/Shop/pack/OnlineShop.class b/out/production/Shop/pack/OnlineShop.class new file mode 100644 index 0000000..6c29925 Binary files /dev/null and b/out/production/Shop/pack/OnlineShop.class differ diff --git a/out/production/Shop/pack/Produkt.class b/out/production/Shop/pack/Produkt.class new file mode 100644 index 0000000..d8bc971 Binary files /dev/null and b/out/production/Shop/pack/Produkt.class differ diff --git a/out/production/Shop/pack/ShopTUI.class b/out/production/Shop/pack/ShopTUI.class new file mode 100644 index 0000000..2e41613 Binary files /dev/null and b/out/production/Shop/pack/ShopTUI.class differ diff --git a/out/production/Shop/pack/Warenkorb.class b/out/production/Shop/pack/Warenkorb.class new file mode 100644 index 0000000..d936b25 Binary files /dev/null and b/out/production/Shop/pack/Warenkorb.class differ diff --git a/out/test/Shop/pack/OnlineShopTest.class b/out/test/Shop/pack/OnlineShopTest.class new file mode 100644 index 0000000..0274a50 Binary files /dev/null and b/out/test/Shop/pack/OnlineShopTest.class differ diff --git a/out/test/Shop/pack/ProduktTest.class b/out/test/Shop/pack/ProduktTest.class new file mode 100644 index 0000000..dd947a6 Binary files /dev/null and b/out/test/Shop/pack/ProduktTest.class differ diff --git a/out/test/Shop/pack/WarenkorbTest.class b/out/test/Shop/pack/WarenkorbTest.class new file mode 100644 index 0000000..5bbc3fb Binary files /dev/null and b/out/test/Shop/pack/WarenkorbTest.class differ