Question: Create a Product and Product Array class 1) Create a Product and ProductArray class with the following private properties.Product productid int productName String unitPrice double

Create a Product and Product Array class

1) Create a Product and ProductArray class with the following private properties.Product

productid int

productName String

unitPrice double

categoryId int

supplierId int

discontinued boolean

ProductArray

productArray

ToString()

2) Create the Accessor methods for all the above. (the gets and sets).

3) Create a toString() method that prints all variables and their values out for each class.

For example, for the product class, the toString() method would print out something like:

Product Id: 1

Product Name: Chai

Unit Price: 2.99

Category Id: 3

Supplier Id: 10

Discontinued: false

4) Create the following methods and the code needed to make them work.

insertProduct()

findProductById() (assume no duplicate ids)

findProductsByCategory() (assume there can be duplicates)

deleteProductById() (assume no duplicate ids)

deletedDiscontinuedItems() (assume there can be duplicates)

5)Create a ConsoleView class.

6)Create a MainController class.

7)In the MainController create at least 10 objects for the product class, and one ProductArray class.

8)Add the Products to the Product Array class.

9)Use the toString() method to print out the information for all 10 objects using a ConsoleView. Show that your code for the methods in part 4 above works by using the methods and then running toString(). That is, insert the products, run toString, find the products, then delete the products and run toString. Make a text document showing your code and your output. Make sure your name is on it and that it is a professional looking document that you could show to your boss.

Be sure to follow our Java Style guide.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!