Question: Write a program that will generate a random recycle bin. This program will have a menu that allows the user to generate a new recycle

Write a program that will generate a random recycle bin. This program will have a menu that allows the user to generate a new recycle bin, print the current recycle bin, add an item, remove an item or quit. Every recycle bin will have a variable number of the following 5 items: plastic bottles, glass bottles, aluminum cans, cardboard boxes, other recyclables. You can use a two dimensional list if you wish, but I suggest using two lists. One list for the names of the items and a second list that holds the number of each item.

2. I suggest the following 7 functions:

fillRecycleBin - uses random to generate a number for each of the items and stores it in a list.

printRecycleBin - prints the number of each item in the current recycle bin

addItem - adds one of the indicated item from the list (e.g. if the user has 8 plastic bottles and wants to add one, after calling the function they will have 9 plastic bottles)

rmItem - removes one of the indicated item from the list (e.g. if the user has 8 plastic bottles and wants to remove one, after calling the function they will have 7 plastic bottles)

printMainMenu - prints the main menu with the choices and what the user should type

printItemMenu - prints the item menu for the addItem and rmItem functions

main() - prints the welcome, initializes a recycle bin and then has a loop to control the main program allowing the user to continue to make choices until quitting.

3. These are only suggestions. The quiz may be completed with a differing structure but you must use at least 5 functions in your program

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!