Question: Write a Java program that manages an inventory of 5 products in an electronics store. Each product has a name, price, and a quantity in

Write a Java program that manages an inventory of 5 products in an electronics store. Each
product has a name, price, and a quantity in stock. The program should allow the user to update
stock, display all products, find the product with the highest price, find the product with the
lowest quantity, and search for a specific product by name (case insensitive). If two or more
products have the same highest price or the same lowest quantity, the program displays the first
product that matches the criterion.
When the program starts, it displays Welcome to Inventory Management System. It
then reads information of the 5 products. The user provides this information on a separate line
for each product. In each line, the first input is the price, the second input is the quantity, and
the rest of the input is the name of the product. You can assume a perfect user; all input is valid.
For example, the following line:
24507 HP Laptop
is for a product called HP Laptop, quantity is 7, and the price is 2450 dollars.
The program should continue running until the user selects "Exit". On exit, the program displays
Goodbye! before exiting.
Instructions:
1. Create three arrays:
o A String array to store the names of 5 products,
o An array of doubles to store the prices of the products, and
o An int array to store the quantity in stock for each product.
2. The program should display a menu with the following options:
1. Display information of all products
2. Update the quantity of a product
3. Search for a product by name
4. Find the product with the lowest quantity
5. Find the product with the highest price
6. Exit

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 Programming Questions!