Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

Workshop

The Workshop provides quiz questions and an exercise to help solidify your understanding of encapsulation and provide you with experience in using what you've learned. Answers are provided in Appendix A, "Answers to Quizzes."

Quiz

  1. What's the recommended scope for member data in a well-encapsulated class design?

  2. What's the purpose of encapsulation in class design?

  3. What interfaces are available to users of an encapsulated class?

Exercise

Modify the Books class in Listing 3.5 to add a subroutine, FillList(), that queries the book data and loads the results into a supplied ListView object. By defining this subroutine, you extend the functionality of the Books class, which in turn removes the code from the user application.

  • + Share This
  • 🔖 Save To Your Account