Question: You will write a program that utilizes 2 arrays, each array will be one-dimensional. One array will contain a product number and the other the
You will write a program that utilizes 2 arrays, each array will be one-dimensional. One array will contain a product number and the other the inventory amount. These will be parallel arrays. With this in mind, complete the following: This program will simulate a form of inventory control. Write a program that creates two parallel arrays one for product number and one for inventory amount. Create and initialize two parallel arrays using either user input or hard code the array information. The array will allow the user to decrease or increase inventory amounts based on sales or purchases. The user will be prompted to reorder if the inventory has two or fewer items in inventory. Determine the total number of items in inventory. Sales will reduce inventory for F5678 by 2 items. Reduce item D4567 by 14 items. Write a method inventoryAverage() that should return the average amount of inventory. Also create a highestInventory which will find the item with the most inventory (item number and inventory will be displayed). Sort the arrays based on the inventory amount. Use the test data below Product Inventory A1234 10 B2345 4 C3456 7 D4567 20 F5678 3 G6789 5 H7890 15 Code should yield the following results along with average and highest inventory After inventory changes Inventory list A1234 10 B2345 4 C3456 7 D4567 6 F5678 1 G6789 5 H7890 15 Sorted list H7890 15 A1234 10 C3456 7 D4567 6 G6789 5 B2345 4 F5678 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
