Answered step by step
Verified Expert Solution
Link Copied!

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 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

Explain franchising and how this form of business ownership works.

Answered: 1 week ago

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago