Add Product
parent
2e634fd768
commit
6bc783877c
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue