Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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 Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Which is preferable: a fixed or a flexible exchange rate? Why?

Answered: 1 week ago