Inventory Final Version: Fall 2023
Learning Objective(s)
- Complete the project
- See the advantages of using classes
- Solidify ability to program
Overview of the Program
Finish the inventory control program. Allow the user to load and save inventory, get the status of the inventory, change the status, and add/remove items from the inventory
Specifics
- Use Item and Inventory from last lab. You may use the solution provided if you wish. Because these have been tested, the bulk of this lab is just getting input from the user and calling the right method.
- Create a class called InventoryControl
- it needs constants for every different command that would be entered.
- The main loop should continue to get commands from the user and execute them until the user inputs the quit command
- Commands include:
- load the inventory from a text file
- save the inventory to a text file
- report on the status of a given item
- report the status of all items (including if an item needs restocking)
- report on only the items that need restocking (including the amount to be ordered)
- update how many of a given item is in inventory (by how many were added or removed)
- update the level for restocking for a given item
- add a new item to the inventory
- remove an item completely from inventory
- Have a method to display the menu
- Have a method to ensure that the command in valid
- Have a method that chooses which method to call based on the command entered
- Have a separate method to execute each command
- All file IOExceptions should be caught (not thrown)
- A sample file can be found in the lab folder
- if a method opens a file, it should close it before it returns
Sample dialogue
You can see that output if you run the program in the lab folder. See classroom instructions for more details.
Submission
- Create your SDR.
- In Lessons Learned, include a discussion the overall ease (or not) of writing this program given that Inventory and Item were already written
- If you used any hints, be sure to indicate that in the Outside Resources Used section
- Convert your SDR into a pdf document
- Create an empty zip folder
- Place all 3 java files and pdf document in it.
- Include any testing input files you used
- Submit the zip folder on canvas
Hints
- Help in the typing. Here is a shell if you want it
- Ideas for each command
Optional improvements
Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
- Use a binary file instead of a text file to store and retrieve the data. Also submit a binary file with at least 5 items already in it.