create constructors

main
Lukas Klipfel 2025-12-14 19:27:48 +01:00
parent 3c23864a81
commit 0ef1667de0
7 changed files with 42 additions and 4 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
OnlineShop/.settings/* OnlineShop/.settings/*
*.bkp
*.dtmp

View File

@ -5,6 +5,18 @@ public class Bestellung {
public Warenkorb bestellungen; public Warenkorb bestellungen;
public Boolean storniert; public Boolean storniert;
public Bestellung(int id, Warenkorb bestellungen) {
this.id = id;
this.bestellungen = bestellungen;
this.storniert = false;
};
public Bestellung(int id, Warenkorb bestellungen, Boolean storniert) {
this.id = id;
this.bestellungen = bestellungen;
this.storniert = storniert;
};
public void StorniereBestellung(Warenkorb storniert) { public void StorniereBestellung(Warenkorb storniert) {
}; };

View File

@ -3,4 +3,9 @@ package backend;
public class Kunde { public class Kunde {
public String name; public String name;
public String Adresse; public String Adresse;
public Kunde(String name, String Adresse) {
this.name = name;
this.Adresse = Adresse;
};
} }

View File

@ -8,9 +8,9 @@ public class OnlineShop {
public Warenkorb aktuellerWarenkorb; public Warenkorb aktuellerWarenkorb;
public OnlineShop() { public OnlineShop() {
lager = new ArrayList<Produkt>(); this.lager = new ArrayList<Produkt>();
bestellungen = new ArrayList<Bestellung>(); this.bestellungen = new ArrayList<Bestellung>();
aktuellerWarenkorb = new Warenkorb(); this.aktuellerWarenkorb = new Warenkorb();
}; };
public void AddProdukt(Produkt neu){ public void AddProdukt(Produkt neu){

View File

@ -10,6 +10,15 @@ public class Produkt {
public int mwStSatz; public int mwStSatz;
public int lagerbestand; public int lagerbestand;
public Produkt(int id, String name, int transportGewicht, int netto, int mwStSatz, int lagerbestand) {
this.id = id;
this.name = name;
this.transportGewicht = transportGewicht;
this.netto = netto;
this.mwStSatz = mwStSatz;
this.lagerbestand = lagerbestand;
};
public void UpdateProdukt(Produkt update) { public void UpdateProdukt(Produkt update) {
}; };

View File

@ -7,6 +7,12 @@ public class Warenkorb {
public ArrayList<Integer> anzahl; public ArrayList<Integer> anzahl;
public Kunde kunde; public Kunde kunde;
public Warenkorb(Kunde kunde) {
this.inhalt = new ArrayList<Produkt>();
this.anzahl = new ArrayList<Integer>();
this.kunde = kunde;
};
public int NettoPreis(){ public int NettoPreis(){
return 0;}; return 0;};
public int BruttoPreis(){ public int BruttoPreis(){

View File

@ -8,5 +8,9 @@ https://app.diagrams.net/#Uhttps%3A%2F%2Fgitty.informatik.hs-mannheim.de%2F30292
Or download and open it with drawio. Or download and open it with drawio.
Time Chart: Time Chart:
1:40 for UML and understanding of the Exercise 1:40 for UML and understanding of the Exercise
0:40 for Creating Java project with UML defined Classes. 0:40 for Creating Java project with UML defined Classes.
0:06 creating constructors