Description
Description: For this assignment, we are going to be organizing our variables into arrays! To the user it will appear that nothing has changed – but on the back end, we are making the code more efficient.
You will also need to create a flowchart and an array diagram like the one pictured at the end of this document.
Requirements:
Using the guidelines below, implement the following arrays into your program. Remember to use global variables for array size rather than hard coding their size.
- Create the following arrays:*
- productInventory[] – should store the quantities of products you currently have in-stock. This array should be updated whenever a product is sold.
- productPrices[] – this array stores the prices for your products
- productWeights[] – this array stores the weights for your products.
- productNames[] – this array holds the names of your products.
*NOTE: These arrays should be parallel to each other for consistency. For example, index 0 is always in reference to product1 no matter which array is being referenced.
- Once your arrays are created, update all references to product prices, inventory, weight, or name to be populated from the array (this includes calculations).
- You should always be processing your arrays with loops rather than directly referencing an index.
- Create a menu for the user to do the following:
- Display the contents of the arrays
- Calculate the total value of the inventory
- Look up the price of an item (user chooses the item)
- Identify the most expensive item in your inventory
- Each of the above menu items should correspond with their own function.
- Output must be labelled and easy to read as shown in the sample output below.
- Program must be documented with the following:
- // Name
- // Date
- // Program Name
- // Description
Madison Hayes –
What a great and timely solution. I got my instructor impressed with the submission. Solution file included console output, flowchart, process reflection, main program, and test data. Thanks and highly recommended to all students.