CSCI 270                                    Study Guide for Review Quiz

                                      

 

Chapter 4  C++ Classes

 

Quiz 4.1 (p. 145): 1, 2

Quiz 4.2 (p. 150): 1, 2, 4, 5

Quiz 4.5 (p. 187): 3, 7, 8, 10

 

Define the private portion of a class to model:

1)      A class Checker for the position of a checker on a board (besides the position of the check we must also keep track of its color, whether it is a regular or a king, can you thing of others?)

2)      A class Card for cards in a deck of playing cards.

 

Add some appropriate operations to the Card class and give implementations of the member functions.  Include constructors, methods to set the rank and suit of the card, and overload the == operator to compare if two Card objects are equal.

 

 

Section 2.4 Pointers

Quiz 2.4 (p. 73): 1, 2, 3, 4, 5-13

Exercises 2.4 (p. 74) : 2-8

 

 

Section 3.4 Dynamic Memory Allocation

 

Quiz 3.4 (p. 122) : 1, 2, 3, 5, 6, 7

Execises 3.4 (p. 123) : 1, 2, 3, 4