Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3: Create Classes (30 points) XYZ City has a strict recycling policy where recycle bins only take glass objects ycle bins only take glass
Problem 3: Create Classes (30 points) XYZ City has a strict recycling policy where recycle bins only take glass objects ycle bins only take glass objects (represented by en the letter g) and paper objects (represented by the letter p). Trash bins can take any object. Create the two classes needed to complete the given main (do not mocny the sample run. Note that the function bin items prints out all items in the given bin. int main(int argc, char** argv) Object 03('b',"plastic bag"); Object 04('b', "plastic bag"); Object 01('g', "jar"); Object 02('p',"newspaper"); Bin trashbin("trash"); Bin recyclebin("recycle"); Sample Run: Throwing away jar in the trash. Throwing away plastic bag in the trash. Throwing away newspaper in the recycle bin. Oops! Wrong bin, can't recycle this! ***trash bin has: jar plastic bag trashbin.throw_in_bin(01); trashbin.throw_in_bin(03); recyclebin.throw_in_bin(02); recyclebin.throw_in_bin(04); ***recycle bin has: newspaper trashbin.bin_items(); recyclebin.bin_items()
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