Add Product

main
CPlaiz 2025-12-13 16:09:25 +01:00
parent 2e634fd768
commit 6bc783877c
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package org.example;
public class Product {
String name;
float weight;
float price;
float vatPortion;
public Product(String name, float weight, float price, float vatPortion) {
this.name = name;
this.weight = weight;
this.price = price;
this.vatPortion = vatPortion;
}
public float getPriceWithVat() {
return price + getVat();
}
public float getVat() {
return price * vatPortion;
}
}