The objectives of this lab are to implement an inheritance hierarchy into our Shop project.
In Eclipse, create a new project called ShopV7.0.
Right-click on the src folder and select New, followed by Package. Enter “models” as the package name:
Create two more packages: “controllers” and “utils”.
Copy the ShopV6.0 files into the ShopV7.0 project to the locations specified in the screen shot below. The project should be error free:
In Eclipse, open ShopV7.0 (if it isn't open already).
In the models package, create a new class called DairyProduct that extents Product. This class should have:
In the models package, create a new class called Milk that extents DairyProduct. This class should have:
In the models package, create a new class called Butter that extents DairyProduct. This class should have:
In Eclipse, open ShopV7.0 (if it isn't open already).
Open the class, MenuController and locate the readProductDetails() method.
We need to make the following changes to this method so that we can input either Milk or Butter details:
Now locate the updateProductDetails() method. Do you need to make any changes here?