Question: How to write C++ program incl. explanations using 2D array method stack with the following conditions: There are 5 racks of eggs stacked one by

How to write C++ program incl. explanations using 2D array method stack with the following conditions: There are 5 racks of eggs stacked one by one, each rack contains 10 eggs (visualized with the number 0). The seller takes the eggs from left to right on each shelf, if someone buys eggs, the position of eggs does not shift. Every shelf that is empty, the shelf is lifted. Buyer can't buy eggs beyond the existing stock. 0000000000 0000000000 0000000000 Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 1 Initialize the egg success Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 3 Enter how many eggs wants to buy: 4 4 eggs sold out Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 2 Egg rack Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 2 Egg rack 0000000000 0000000000 0000000000 0000000000 0000000000 Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 3 Enter how many eggs wants to buy: 7 7 eggs sold out 000000000 0000000000 0000000000 0000000000 Menu: 1. Initialize the egg 2. Look at the egg rack 3. Buy egg 4. Out Select menu (1-4): 2 Egg rack 000 0000000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
