Exercises


  • Create a basic Tortilla class with a constructor for attributes such as crispiness, freshness, etc. The attributes should be stored in private data members.
  • Use the Tortilla class as a data member of a Taco class, along with other members such as amount of meat, toppings, etc. All of these members should be initialized through a constructor which takes all of the data from parameters sent to it.
  • Create a Taco class similar to the last one, but with multiple constructors (remember function overloading?) which can take different parameters (You could say have one constructor for a meatless taco, and one for a very meatful taco).
  • Create yet another Taco class, this time using default parameters in your constructor so that if just a Taco() is created, then the user will get a generic Taco Belle style Taco.
  • With the advent of double decker Tacos, one data member to store the Tortilla just isn't enough. Modify the Taco class of your choosing to contain a linked list of Tortillas (you'll need to create a class for that too). Be sure to properly use new and delete on the linked list in the Taco constructor and destructor.


Table of Contents

Constructors | Destructors | Defining Long Functions | Interface vs. Implementation
Exercises