Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program will create a structure named Bin and will have the following fields and associated data types as members Content ( char array
Write a program will create a structure named Bin and will have the following fields and associated data types as members
Content char array size
count integervalid range or greater
We will have a vending machine initially with the following items in the bins
Bin # Water
Bin # Tea
Bin # Coffee
Bin # Lemonade
Bin # Cola
Bin # Chocolate
Bin # Latte
Bin # GingerAle
The above should be stored in an array
Your program needs to create two functions addItem and delItem that pass the Bin number, array of bins, and the amount to either add or delete from the bin respectively
Make sure the amount to add or delete is positive and since each Bin has a maximum capacity of items when adding you must make sure that it is not added beyond that and that the values will not go below Demonstrate adding and removing items from the Bins in the main
NOTE: No global variables allowed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started