Dateien nach "/" hochladen

Erstellen der Klasse Products mit Konstruktur sowie der erstellung der Grundpreis Rechnung
main
Fatima Zehra Ulu 2025-12-14 21:41:18 +01:00
commit e4801d4c8f
1 changed files with 54 additions and 0 deletions

54
OnlineShop.java 100644
View File

@ -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;
}
}
}