CS 202 Fall 2013  >  In-Class Challenge for Tuesday, October 15, 2013

CS 202 Fall 2013
In-Class Challenge for Tuesday, October 15, 2013

Class StrPrint

A class StrPrint is defined for you, in files strprint.h and strprint.cpp.

This class has:

What to Do

Do as many of the following as you can before class ends. Along the way, maintain a program that demonstrates whatever functionality you have written. To allow for faster writing, you may put all the code you write into a single file, if you wish. But avoid modifying strprint.h or strprint.cpp.

  1. Write a class Back derived from StrPrint. This new class should override function out to print the string backwards.
  2. Your program should make objects of type StrPrint and Back and call member function out on each, using a pointer of type (StrPrint *).
  3. Write another class derived from StrPrint that prints a string in some other (interesting?) way. Add code that uses it to your program.

Some Reminders


CS 202 Fall 2013: In-Class Challenge for Tuesday, October 15, 2013 / Updated: 15 Oct 2013 / Glenn G. Chappell