Initial commit

This commit is contained in:
LinlyBoi
2022-01-27 19:21:54 +02:00
commit 8e447756ac
22 changed files with 710 additions and 0 deletions

48
src/Products/Product.java Normal file
View File

@@ -0,0 +1,48 @@
package Products;
import java.util.Date;
public class Product
{
String pname;
double unitprice;
Date expdate = new Date();
Product()
{
}
Product(String name, double price, Date date)
{
this.pname = name;
this.unitprice = price;
this.expdate = date;
}
public boolean checkExpired()
{
Date today = new Date();
return expdate.before(today);
}
@Override
public String toString()
{
return "Product name: " + pname + "\nUnit price: " + unitprice + "\nExpiration date: " + expdate;
}
}