Question: Language: Java 1. Create a Product class with the following attributes and methods: - int: price - int: count - String: name - Constructor, accessors,

Language: Java

1. Create a Product class with the following attributes and methods:

- int: price

- int: count

- String: name

- Constructor, accessors, mutators, and toString.

2. Create an Inventory class as a driver with the following functionalities:

A text file named Products.txt for storing the Products.

Each line contains information of one product with the following format:

- Name : price : count

The program shows the following menu to the user:

- 1: add items

Ask the user to enter the products. Once the user entered all products, write the Inventory into the Products.txt with the given format.

- 2: show Inventory

Read the Inventory information from the Products.txt file into an array of Products and print the Inventory information on the screen.

- 0: 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 Databases Questions!