Introduction to Programming in Java Assignment Canned food Inventory System A warehouse is designed to…
SOLUTION AT Australian Expert Writers
Introduction to Programming in Java Assignment
Canned food Inventory System
A warehouse is designed to store canned food in a standard bin.
Each bin can store up to 10 canned foods.
Each bin only stores the same type of canned food.
All the bin stores different type of canned food.
You are tasked to design a Canned food Inventory System to support the operation.
Below is a description of the required Java classes (Bin, CannedFood, MyDate, and CannedFoodWareHouse:
The Bin class has the following minimum requirements.
description: String (holds the type of canned food to be stored in this bin)
stock: Array of CannedFood (size of 10 – store canned food object)
Arguments: Location and Description
Initialize the stock array to a size of 10 CannedFood
Add a cannedFood object to the stock array
Return true if success, return false if array is full
One of the Canned Food in the stock array or
The nearest expiry date in the stock array.
The canned food object must be removed from the stock array.
Implement one of the above, (nearest expiry date will gain higher marks.)
Return null if the stock array is empty
The CannedFood class has the following minimum requirements.
ID: String (unique)
Expiry Date (MyDate data type – year, month, and day)
Note: do not use the standard Date or Calendar class in the Java package.
Arguments: ID, Description, and Expiry Date (year, month day)
Create the MyDate expiry date object in the constructor
– isExpired. Return true if the canned food is expired.
The MyDate class has the following minimum requirements.
month: int (0-Jan,1-Feb, etc…)
Arguments: year, month, day
isBefore(year, month, day)
Return true if the current date is before the passed in the year, month, day.
Hint: use this to check if CannedFood has expired
The main driver class CannedFoodWareHouse has the following minimum requirements:
Bin array (to store the bins that store canned food) Constructor
Initialize the Bin array, we assume there are three bins
Bin 1 – Location: A1, Description: Beans
Bin 2 – Location: A2, Description: Sardine
Bin 3 – Location: A3, Description: Soup
Load the CannedFood data from a file into the three bins stock array. (see appendix for a sample of the data file)
A menu driver method for the user to perform the following operations:
Insert a new canned food:
Select canned food Description and enter ID and Expiry date.
Search for the bin that store this type of canned food.
Store the canned food object into the bin stock array.
List canned food information:
Select canned food Description
Display the stock level of canned food in the bin
Display all the canned food information in the bin
Remove canned food:
Select canned food Description
Search for the bin that store this type of canned food
Get canned food from the bin. (the canned food object needs to be removed from the stock array)
Display the canned food information
Remove expired canned food:
All expired canned food objects in all the bins will be removed.
Exit and Save
Save all the updated canned food object back to the data files and exit the program.
Implement one more function that you deem that it is useful for the system.
Note: the user can keep selecting the Insert, List, and Remove functions until exit.
You are free to add more fields and methods to the above Java classes if you deem that it is appropriate and adhere to a good Object-Oriented design.
You need to handle all possible errors that will occur during the program execution:
No canned food found
The stock array is full
Invalid date entered by the user.
The canned food ID entered by the user is not unique.
Besides the Java Codes, you need to submit the following documentation:
A brief writeup of the system you have implemented
The functions you have implemented according to the requirements.
The functions you have not implemented according to the requirements.
The extra operation method that you deemed useful and have implemented.
The errors checking you have implemented.
Class UML diagram.
A short reflection on implementing this assignment.
The data file format is
<ID>,< Description>,<Expiry Year>,< Expiry Month>,< Expiry Day>
CannedFood.txt data file sample
SO,101, Soup, 2022,7,30
You may use the Java Calendar class to get the current system to check for the expiry date.
Calendar calendar = Calendar.getInstance();
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA Ph. D. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER