The goal of Java program implemented as part of this assignment is to build an Inventory Management...

50.1K

Verified Solution

Question

Programming

The goal of Java program implemented as part of this assignmentis to build an
Inventory Management System, from here on referred to as IMS, for abookstore.
You will need to do the following tasks:
Requirement-1 – Create 3 different Arrays (15 pts)
(a) Create an array named items that will hold the following itemnames (strings)
- Pen
- Pencil
- Eraser
- Marker
- Notepad
(b) Create a second array named quantity, that will holdcorresponding quantities
for items in the items array above. This will be populated throughuser inputs.
For each input you get from the user, be sure to check it is anumber > 0. If
not, continue to ask the user for the right number.
Hint: User the handy-dandy Scanner to read user input, the if-elseconstruct to
validate user input and the loop to repetitively ask for user inputshould you
get an unacceptable value
(c) Create a third array named price, that will hold price-per-itemfor the items
stored in the first array. The price point for each item shouldalso come from
the user. For example, a notepad could be priced at $1.47, eraserat $0.76 etc.
As in the above case, for each price point input you get from theuser, be sure
to check it is a number > 0. If not, continue to ask the userfor the right
number for the item price.
The message, for example, could look like “Please enter price for aNotebook”
(d) Based on the type of data that needs to be stored in theabove-mentioned
arrays, be sure to use the correct data type


Requirement-2 –Create Operations for an Inventory Managerrole
(a) Show Functions List
Once the above data points have been correctly created, you willnow need to
build the functional points (operations) for this IMS. But beforewe do that, we
need tell the user about operations that are available to beinvoked by the
user, as part of this IMS. The 5 operations of the IMS are asfollows. So, display
these operations to the user and ask the user to enter the letterfor the
operation that the user wants to run.
- Print Inventory (p)
- Check for Low Inventory (c)
- Highest/Lowest value inventory Items (h)
- Total Inventory Value (t)
- Exit System (e)
Sample output should look something like the following:
Welcome to IMS. Please select a function from the following:
Print Inventory (p)
Check for Low Inventory (c)
Highest/Lowest value inventory Items (h)
Total Inventory Value (t)
Exit System (e)
(b) PrintInventory (15 pts)
This operation should print inventory, starting with the header, inthe
following format
Item_Name Quantity Price Total_Inventory_Value
Eraser 14 $.95 $13.30
Notebook 10 $1.47 $14.70
….
Note:
The last column will show a computed value (price * quantity) forthe item
At the end of this operation, go back to displaying the 5operations that user
can choose from, as in (a) above
(c) checkForInventory
This operation checks for items that have quantity less than 5, andthen prints
them in the same format as in (b) above. For example:
Items with quantity less that 5:
Item_Name Quantity Price Total_Inventory_Value
Notebook 7 $1.47 $10.29
Marker 4 $1.02 $4.08
….
….
At the end of this operation, go back to displaying the 5operations that user
can choose from, as in (a) above
(d) highestAndLowestValueItems
This operation finds the highest, and lowest, value item(s) ininventory,
computed by multiplying the quantity with the price for that item,and then
prints them in the same format as in (b) above.
Highest Inventory Value Items:
Item_Name Quantity Price Total_Inventory_Value
Notebook 7 $1.47 $10.29
Marker 4 $1.02 $4.08
….
Lowest Inventory Value Items:
Item_Name Quantity Price Total_Inventory_Value
Pencil 4 $.74 $2.96
Marker 2 $1.02 $2.04
….
At the end of this operation, go back to displaying the 5operations that user
can choose from, as in (a) above
(e) totalInventoryValue
This operation simply prints the Grand Total value of the entireinventory. This
will essentially be the summation of all individual total values ofeach item in
the inventory
At the end of this operation, go back to displaying the 5operations that user
can choose from, as in (a) above
(f) exit
This operation simply exits the program

Answer & Explanation Solved by verified expert
4.3 Ratings (687 Votes)
package comexampleimport javautilScannerimport static javalangSystemexitpublic class IMS String items Pen Pencil Eraser Marker Notepad int quantity new int5 double price new double5 void initialize for int i 0 i 5 i SystemoutprintlnPlease enter quantity for itemsi quantityi getValidQuantityitemsi for int i 0 i 5 i SystemoutprintlnPlease enter price for itemsi pricei getValidPriceitemsi int getValidQuantityString str Scanner scanner new ScannerSystemin int count while true count    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students