Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a safe harbor 401(k) plan?30

Answered: 1 week ago