Create Java project with UML classes
parent
9aaabb6160
commit
3c23864a81
|
|
@ -0,0 +1 @@
|
|||
OnlineShop/.settings/*
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
@ -0,0 +1 @@
|
|||
/bin/
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>OnlineShop</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package backend;
|
||||
|
||||
public class Bestellung {
|
||||
public int id;
|
||||
public Warenkorb bestellungen;
|
||||
public Boolean storniert;
|
||||
|
||||
public void StorniereBestellung(Warenkorb storniert) {
|
||||
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package backend;
|
||||
|
||||
public class Kunde {
|
||||
public String name;
|
||||
public String Adresse;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package backend;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class OnlineShop {
|
||||
public ArrayList<Produkt> lager ;
|
||||
public ArrayList<Bestellung> bestellungen;
|
||||
public Warenkorb aktuellerWarenkorb;
|
||||
|
||||
public OnlineShop() {
|
||||
lager = new ArrayList<Produkt>();
|
||||
bestellungen = new ArrayList<Bestellung>();
|
||||
aktuellerWarenkorb = new Warenkorb();
|
||||
};
|
||||
|
||||
public void AddProdukt(Produkt neu){
|
||||
};
|
||||
public void UpdateExistingProdukt(Produkt alt, Produkt neu){
|
||||
};
|
||||
public String[] ShowWarenkorb(){
|
||||
return new String[0];
|
||||
};
|
||||
public String[] SearchProdukt(){
|
||||
return new String[0];
|
||||
};
|
||||
public void AddProduktZuWarenkorb(Produkt add){
|
||||
};
|
||||
public void DelProduktAusWarenkorb(Produkt del){
|
||||
};
|
||||
public void ChangeProduktInWarenkorb(Produkt change, int count){
|
||||
};
|
||||
public void MoveProduktInWarenkorb(Produkt move, int direction){
|
||||
|
||||
};
|
||||
public void UpdateKundeInWarenkorb(Kunde neu){
|
||||
|
||||
};
|
||||
public void AddBestellung(Warenkorb bestellung){
|
||||
};
|
||||
public String[] ShowBestellungen(){
|
||||
return new String[0];
|
||||
};
|
||||
public void StorniereBestellung(Bestellung storniert){
|
||||
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package backend;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Produkt {
|
||||
public int id;
|
||||
public String name;
|
||||
public int transportGewicht;
|
||||
public int netto;
|
||||
public int mwStSatz;
|
||||
public int lagerbestand;
|
||||
|
||||
public void UpdateProdukt(Produkt update) {
|
||||
};
|
||||
|
||||
public int BruttoPreis() {
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package backend;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Warenkorb {
|
||||
public ArrayList<Produkt> inhalt;
|
||||
public ArrayList<Integer> anzahl;
|
||||
public Kunde kunde;
|
||||
|
||||
public int NettoPreis(){
|
||||
return 0;};
|
||||
public int BruttoPreis(){
|
||||
return 0;};
|
||||
public int NettoVersandkosten(){
|
||||
return 0;};
|
||||
public int BruttoVersandkosten(){
|
||||
return 0;};
|
||||
public int NettoGesamtPreis(){
|
||||
return 0;};
|
||||
public int BruttoGesamtPreis(){
|
||||
return 0;
|
||||
};
|
||||
public void AddProdukt(Produkt add, int count){};
|
||||
public void DelProdukt(Produkt del){};
|
||||
public void ChangeProdukt(Produkt change, int count){};
|
||||
public void MoveProdukt(Produkt move, int direction){};
|
||||
public void UpdateKunde(Kunde neu){};
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
module OnlineShop {
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package tui;
|
||||
import backend.OnlineShop;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class ShopTUI {
|
||||
public static void main(String[] args) {
|
||||
OnlineShop shop = new OnlineShop();
|
||||
Scanner sc = new Scanner(System.in);
|
||||
Menu(shop, sc);
|
||||
System.out.println("Ende.");
|
||||
}
|
||||
|
||||
private static void Menu(OnlineShop shop, Scanner sc) {
|
||||
shop.test = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,3 +6,7 @@ https://app.diagrams.net/#Uhttps%3A%2F%2Fgitty.informatik.hs-mannheim.de%2F30292
|
|||
https://app.diagrams.net/#Uhttps%3A%2F%2Fgitty.informatik.hs-mannheim.de%2F3029257%2FProgrammiertestat_2%2Fraw%2Fbranch%2Fmain%2FVersandkostenpreis%2520Netto%2520berechnung.svg
|
||||
|
||||
Or download and open it with drawio.
|
||||
|
||||
Time Chart:
|
||||
1:40 for UML and understanding of the Exercise
|
||||
0:40 for Creating Java project with UML defined Classes.
|
||||
|
|
|
|||
Loading…
Reference in New Issue