...

/

Exercise 2: Expired or Not?

Exercise 2: Expired or Not?

In this exercise, you have to compare the expiry dates of two products and, based on that, suggest which brand's product should be bought.

Problem Statement

In this exercise, you are given a class Product. You need to implement the following tasks:

Task 1

Define the constructor which takes and initializes the following properties:

  • name: the name of the product.

  • price the price of the product.

  • amount: the amount of product available in inventory.

  • madeIn: the country in which the product is made in.

  • expiryDate: the expiry date of the product.

  • brand: the name of the brand that made the product.

Task 2

Define a static ...