Kleinere Updates im Code
TODO für weitere Schritte hinzugefügt Datei mit Produktliste hinzugefügtmain
parent
1ddadc8dcf
commit
c545955856
|
|
@ -0,0 +1,8 @@
|
||||||
|
ProdId,Name,TransportGewicht,Netto,MwStSatz,Lagerbestand
|
||||||
|
1,Riesling 0.7 l,1.2,4.20,19,87
|
||||||
|
2,Pfälzer Saumagen 250 g,0.28,2.52,7,23
|
||||||
|
3,Gewürznelken 100 St.,0.01,2.52,7,3
|
||||||
|
4,Kokosmilch 250 ml,0.275,1.67,7,12
|
||||||
|
5,Bratwurst grob 250 g,0.258,2.09,7,17
|
||||||
|
6,Traubensaft 1.0 l,1.5,2.93,19,1
|
||||||
|
7,Gieskanne,0.2,3.80,19,13
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class OnlineShop {
|
||||||
public OnlineShop() {
|
public OnlineShop() {
|
||||||
lager = new ArrayList<Produkt>();
|
lager = new ArrayList<Produkt>();
|
||||||
|
|
||||||
|
// TODO: Hier sollte die Produktliste geladen werden, vgl. Sudoku
|
||||||
lager.add(new Produkt("Wein", 4.99));
|
lager.add(new Produkt("Wein", 4.99));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,6 @@ public class Produkt {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.name;
|
return this.name + " " + this.preis + " Euro.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,36 @@ package de.th_mannheim.informatik.shop.tui;
|
||||||
import de.th_mannheim.informatik.shop.backend.OnlineShop;
|
import de.th_mannheim.informatik.shop.backend.OnlineShop;
|
||||||
|
|
||||||
public class ShoppingTUI {
|
public class ShoppingTUI {
|
||||||
|
private static OnlineShop shop;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Willkommen beim THMA SuperStore!");
|
System.out.println("Willkommen beim THMA SuperStore!");
|
||||||
|
|
||||||
OnlineShop shop = new OnlineShop();
|
shop = new OnlineShop();
|
||||||
|
|
||||||
|
// TODO: Hauptmenü aufrufen, am besten in einer Schleife
|
||||||
|
|
||||||
|
produktangebot(); // nur als Beispiel, bitte hier entfernen
|
||||||
|
|
||||||
|
System.out.println("Auf Wiedersehen!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hauptmenü() {
|
||||||
|
// TODO: hier ein erstes Menü mit bspw.
|
||||||
|
// Produktangebot
|
||||||
|
// Produktsuche
|
||||||
|
// Warenkorbanzeige
|
||||||
|
// evtl. Bestellung (kann auch über Warenkorb realisiert werden)
|
||||||
|
// Exit
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void produktangebot() {
|
||||||
System.out.println("Unser Produktangebot:");
|
System.out.println("Unser Produktangebot:");
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
String[] produkte = shop.produktListe();
|
String[] produkte = shop.produktListe();
|
||||||
for (int i = 0; i < produkte.length; i++)
|
for (int i = 0; i < produkte.length; i++)
|
||||||
System.out.println((i+1) + ". " + produkte[i]);
|
System.out.println((i+1) + ". " + produkte[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue