Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Problem Description The XYZ retail outlet manages its entire inventory using a text file "inven

  Asked By: Mali    Date: May 14    Category: Java    Views: 1063

Can anyone help me with this problem or point me to a similar one
which can give some guidelines to completing it. I am new to java so
I'm learning as I go along....Thanks RR.

Problem Description
The XYZ retail outlet manages its entire inventory using a text
file "inventory.dat" with the following format:
Item id: (String)
Description (String may contain one or more words)
Stock Quantity: (int)
Unit Cost Price:(float)
Unit Selling Price:(float)
Reorder Level:(int)

You are required to write a Java program to manage the inventory
items and give the following deliverables:

1. Create a class called "InventoryObject" to capture the data
for a single record from the file.
a. Allow the class to have set and get methods for each of its
instances variables.
b. A toString() method that returns the data in the following
format per line e.g.
i. PL192-01
ii. Porch Lighting Fixture
iii. 124
iv. 75
v. 125
vi. 25
2. Create a class called "InventoryManager" that manages a list
of InventoryObjects (i.e. an array of inventory objects)
3. Read the input file using dos re-direction e.g. java
InventoryTest < infile.txt
4. Load the data from the input file into the program.
5. Allow the user to search for an object by
i. Id
ii. Cost Price
iii. Selling Price
iv. Quantity
v. Reorder Level

6. Allow the user to edit
i. Cost Price
ii. Selling Price
iii. Quantity
iv. Reorder Level

7. Display Sorted data by
i. ID
ii. Description
iii. Cost Price
iv. Selling Price
v. Expected Profit Margin i.e. [Quantity * (Selling Price –
Cost Price)]

8. Save the inventory data to disk using the method
FileOperations.saveFile (String pathname) to save the data to a
file (This class will be provided by the lecturer)
a. E.g. FileOperations.saveFile ("A:\\inventory.dat");



1 Answer Found

Answer #1    Answered By: Aaliyah Khan     Answered On: May 14

you are new to java  but furnish a big program.
this program  will be made by using FileReader
you have to create  read,write and save
Since it is text  file one has to very careful before
making a program.
one suggestion you should use database instead of text