From e4801d4c8fd29aab76a7e0dcf22e20f14a1983fa Mon Sep 17 00:00:00 2001 From: Fatima Zehra Ulu <3026753@stud.hs-mannheim.de> Date: Sun, 14 Dec 2025 21:41:18 +0100 Subject: [PATCH] Dateien nach "/" hochladen Erstellen der Klasse Products mit Konstruktur sowie der erstellung der Grundpreis Rechnung --- OnlineShop.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 OnlineShop.java diff --git a/OnlineShop.java b/OnlineShop.java new file mode 100644 index 0000000..a36bdbf --- /dev/null +++ b/OnlineShop.java @@ -0,0 +1,54 @@ +package Shop; +public class OnlineShop{ + +public static void main (String [] args){ + + +} + + public class Products{ + private String Name; + private double weight; + private double netWorth; + private double tax; + private int stock; + + // Constructor for the Products class + public Products(String Name, double weight, double netWorth, double tax, int stock) { + this.Name = Name; + this.weight = weight; + this.netWorth = netWorth; + this.tax = tax; + this.stock = stock; + } + + public String getName(){ + return Name; + } + public double getWeight(){ + return weight; + } + public double getNetWorth(){ + return netWorth; + } + public double getTax(){ + return tax; + } + public int getStock(){ + return stock; + } + + // Brutto Preis + public double getGrossPrice(){ + return this.netWorth *(1+this.tax/100); + } + + // Reine Steuer + public double getTaxAmount(){ + return this.getGrossPrice()-this.netWorth; + } + + + } + +}