Question
Q1. You are supposed to implement a food carriage belt for McDonalds. User is asked to create a moving belt for different food items. This
Q1. You are supposed to implement a food carriage belt for McDonalds. User is asked to create a moving belt for different food items. This belt operates between the kitchen and the sales counter of McDonalds. Size of the belt depends on users choice, but user cannot change it after it has been created. For the sake of simplicity, you may assume that all food items are represented by two attributes: name and availability. Availability attribute is 1 if item is on belt otherwise it is 0. Kitchen workers keep on placing food items on the belt and the sales persons keep on selling items from the belt. You have to write a complete program which will implement following functionality: 1. Place a new item on belt (create a new object and make its availability=1) 2. Sell an item from the belt (make its availability=0) Your program MUST ensure that the items placed first should be sold first (order must be preserved). It MUST also make sure that you cannot place items more than the capacity of belt and you cannot go for the sales option when there is no item on belt. Your program should be running in an infinite loop and every time, it should ask one of the options: Place or Sell.
<<<<
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