Question: Problem 1 : Store Product Inventory Create a Java program that manages a store's product inventory. Define two classes: Product and Store. The program prompts

Problem 1: Store Product Inventory
Create a Java program that manages a store's product inventory. Define two classes:
Product and Store.
The program prompts the following menu:
Add product
Print a product details
Exit
Product Class:
Create a Product class with the following attributes:
productName (String): the name of the product.
brand (String): the brand of the product.
productld (String): a unique identifier for the product.
Store Class:
Create a Store class with the following attributes:
products (an array of Product objects): to store the collection of products in the store, the maximum number of products is 3.
Implement the following methods in the Store class:
addProduct(Product product): adds a product to the store.(Allow the user to enter the values). If the user entered a mismatched value or tried to add more than 3 the application should print an error message using Exception Handling.
displayProducts(): displays the details of the product by entering the Product number, and it has to be within the range or it will print error message (NullPointerException).
 Problem 1: Store Product Inventory Create a Java program that manages

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!