Question: 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 32)
count (integer)--valid range 0 or greater
We will have a vending machine initially with the following items in the bins
Bin #1 Water 10
Bin #2 Tea 5
Bin #3 Coffee 8
Bin #4 Lemonade 23
Bin #5 Cola 12
Bin #6 Chocolate 8
Bin #7 Latte 2
Bin #8 GingerAle 7
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 40 items when adding you must make sure that it is not added beyond that and that the values will not go below 0. Demonstrate adding and removing items from the Bins in the main().
NOTE: No global variables allowed
 Write a program will create a structure named Bin and will

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!