CS 218 - Object Oriented Programming with C++

Review for Third Test

Students should review the self tests for all chapters covered so far: chapter 11, chapter 12, chapter 13, chapter 14, and chapter 15 on the textbook author's web site. Each time you ask for a self test, you should get 20 random review questions for a chapter. Review each of them several times.

The questions below also provide review for this material. Please review them as well.

  1. What os a struct? How is it created?

  2. How is a struct like an array? How is it different?

  3. How do you assign a value to a member of a struct?

  4. What kinds of inheritance does C++ support?

  5. What are classes called that inherit from other classes? What are classes called that other classes are created from?

  6. What are the three memberAccessSpecifiers?

  7. If a base class has public members, how is this reflected in public inheritance by derived classes? How are protected members affected?

  8. If a base class has public members, how is this reflected in private inheritance by derived classes? How are protected members affected?

  9. If a base class has public members, how is this reflected in protected inheritance by derived classes? How are protected members affected?

  10. How are private members treated, regardless of the memberAccessSpecifier?

  11. What is the difference between redefining and overloading an inherited function?

  12. What is the base class of the istream and ostream classes?

  13. What is the syntax for creating a variable that is a point to int? What is the syntax for creating two such variables in the same declaration?

  14. By default, what operations are allowed on pointer variables?

  15. Why is it accurate to describe the name of an array as a constant pointer?

  16. What is the syntax for a function header that allows it to receive a pointer by reference?

  17. Which members of a base class can a derived class never directly access?

  18. What does it mean to override a base class member function?

  19. How do you call a function in a base class if it is overridden in the derived class?

  20. What is the data type of a pointer? Explain your answer.

  21. What is the address of operator? What is the dereferncing operator?

  22. If we have a pointer on the left side of an equal sign, there could be one of four things on the right side of that equal sign. What are they?

  23. Assume a pointer called ptr. What are the possible meanings of:
    • ptr
    • *ptr
    • &ptr

  24. What operator is used to create a dynamic variable? What operator is used to destroy it? What is the operand of such a command?

  25. What are some unusual features about dynamic arrays?

  26. What is a shallow copy? What is a deep copy? How could something go wrong with each of those situations?

  27. Students should review the code examples online and in the text, making sure to understand them. There will be code questions on the test.