Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Objective-C > Gold Challenge: Another Class

Gold Challenge: Another Class

Create a subclass of BNRItem named BNRContainer. A BNRContainer should have an array of subitems that contains instances of BNRItem. Printing the description of a BNRContainer should show you the name of the container, its value in dollars (a sum of all items in the container plus the value of the container itself), and a list of every BNRItem it contains. A properly-written BNRContainer can contain instances of BNRContainer. It can also report back its full value and every contained item properly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial