Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write this in Java, and follow all instructions, including implementation of the config.txt and inventory.bin Please make sure to have done these: This programming

Please write this in Java, and follow all instructions, including implementation of the config.txt and inventory.bin

image text in transcribed

Please make sure to have done these:

image text in transcribed

This programming assignment will expand on our usage of arrays, when reading and writing to files. The purpose of this assignment is to learn how to interact with both text and binary file to store/retrieve information, as well as properly handing exceptions Assignment Task(s) The programmer will create an application called "Inventory". This application will read the contents of a binary inventory file (inventory.bin) and store the contents into an array of class type Inventoryltems. The variables contained in this class include the Item Name, the amount of items on hand, and the current price Your application will contain a few user options (sample below) INVENTORY File System A. Inventory File Name B.Di3play InventorY C. Add/Modify Inventory Item D. Delete Inventory Item E. Save Updates . Quit User Choice (A-E,Q) [I The application will also use a local text configuration file (config.txt), which stores the location of the inventory file and the number of items in the inventory list. This information can be stored in any manner as you wish. When initiating the application, it will read the configuration file to find the location of the inventory file. If the inventory file exists, the inventory items will automatically be read The application will create an InventoryltemNotFoundException, which will be used when searching the database for an existing item. The application will contain a method for searching the database for a file, this method will return a InventoryltemNotFoundException if the item is not in the inventory list. The application will prompt the user for an item. After the item has been entered, the application will search the existing database to determine if the item already exists. If the item exists, the application will prompt the user for the new price and number of items on hand. If the item does not exist, the application will prompt to enter the original price and the number of items on hand If the user selects to delete an item, the application will search the database for the item. If the item is contained in the inventory, the item will be deleted. If the item is not in the database, the user will receive an "Item Not Found" error Updates to the inventory file will only be made if the user selects to "Save Updates" The application must be able to switch between inventory files. If the entered inventory filename does not exist, the application shall properly handle the FileNotFoundException

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago