Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Create a NetBeans project named Week11Lab_YourId. Include the following interfaces and classes. - Interface Measurable, as defined in your lecture. - Class Data, as

Problem: Create a NetBeans project named Week11Lab_YourId. Include the following interfaces and classes. - Interface Measurable, as defined in your lecture. - Class Data, as defined in your lecture - Add to your Data class two more methods: o A static method max to get the Measurable object with the largest measure in an array of Measurable objects o A static method min to get the Measurable object with the smallest measure in an array of Measurable objects - Class Item that defines an item in terms of its ID, name, price and quantity. Include the following for this class: o A constructor to initialize an item data o Get methods for all item data o Set methods for all item data o toString method that returns an Item object information as shown in the sample run. o Item class should implement interface Measurable o Item class should implement interface Comparable - Class Shop that maintains a shop catalog as an array of Items, catalog capacity and catalog current size. Include the following for this class: o A constructor to construct the catalog array for a given capacity, and initialize the capacity and the current size. o A method to add an item to the catalog given item information(i.e.id, name,price,quantity) o A method to add get an item in the catalog given its index. o A method to get the most expensive item using method Data.max(). o A method to get the cheapest item using method Data.min(). o A method to sort catalog items using Arrays.sort(). o toString method that returns an Item object information as shown in the sample run. o A method that returns the capacity of the catalog o A method that returns the size of the catalog o A method that returns a boolean value indicating if the catalog is full or not.

- Class GiftShop application that creates a Shop object, prompts the user to enter item information and add them to the shop object. Then it prints the current items in the shop catalog in a sorted form. It also prints the most expensive item and the cheapest item. (See the sample run) (Optional) - Add an interface Filter with a method accept that receives a double value and returns a boolean value. - Make Item class implements the Filter interface. Class Item filters its data based on quantity above a given value. - Add to Data class a static method filteredItems that receives an array of Filter objects and a double value and returns an array of Filter objects that satisfy the Item filter value. - Add to Shop class a method that returns an array of the largest stock items using Data.filteredItems() - Add to the GiftShop class a code to print the largest stock items retrieved by the Shop object method defined above.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions