Question: Write a complete C++ program that defines a 2D array to help manage the inventory of a local supermarket. Each row represents a commodity. Columns
Write a complete C++ program that defines a 2D array to help manage the inventory of a local supermarket. Each row represents a commodity. Columns are defined by the figure below. In the table, left four columns are input, right two columns are output. Sale Price Revenue Post- Invent re- Invento The maino0 function does the following. 1) Read the commodity (row) number from the user with proper prompt 2) Populate the columns Sale, Price, and Pre-Inventory using random number generator and assignment statement. 3) Calculate Revenue and Post-Inventory with random data obtained in Step 2). The Revenue should be the product of Sale and Price. The Post-Inventory should be the remaining amount after subtracting Sale from the Pre-Inventory Print out the content of the table (2D array) on the monitor, keeping the table format Note: To use the random number generator, add following code include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
