CSE101 Assignment 04
CSE101 Assignment 04
Due:
Friday, 23-December-2022 by 23:59
Deliverables:
The following Java files should be submitted to MS Teams by the due date and time
specified above. Submissions received after the deadline will be subject to the late
policy described in the syllabus.
o StoreUsingFiles_{StudentNumber}.java
Specifications:
Overview: You will continue the program this week to maintain the inventory for a store. Do
not forget your headers with @author and @since information. This program will be
expanded in CSE 102, so be sure you understand the concepts covered in this program.
Requirements: Write a program that will read files for both the inventory of a store and
the items requested by a customer. It will then write three files to show the results of
filling a customer’s order.
To facilitate the execution of this program, you will write (at minimum) the following
methods:
1. countProducts(filename)
a. A new method to determine how many items are in the store inventory
b. Takes String representing the filename as a parameter
c. Reads the file and counts the lines in the file
d. Returns an integer for the number of lines in the file
2. getProductInfo(itemID, itemName, quantity, price, filename)
a. A new method to fill the arrays with the inventory information
b. The file will be read and the values put into the arrays
c. The file will have the format of item ID, name, quantity, price separated
by spaces
d. It will take five parameters
i. String array for item IDs (a four character unique ID)
ii. String array for names of the items in stock
iii. Integer array for number of each item
iv. Decimal array for price of each item
v. String for the filename
e. Returns None
Design:
When your main method is called, your program should display nothing. All interaction
with the program should be done through reading and writing files. Given the example
files below:
Code: Prior to running your program, only the following example files could be used as
input to the program:
Test: You are responsible for testing your program. It is important to not rely solely on
the examples presented in this Project description.
Grading:
MS Teams Submission: If anything is ambiguous, it is your responsibility to ask questions. It
is also your responsibility to complete this assignment in a timely manner. E-mails with
questions regarding this assignment will likely not be answered if received after 17:00 on the
due date of the assignment. You can submit multiple times using MS Teams, however, we
will only grade the last version that you submitted.
Filename: You must name your java file according to the description above. If your file is not
named in this way, your submission for this assignment will not be accepted.