Online-Shop/OnlineShop.java

55 lines
1.2 KiB
Java

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