Code Fragment: TestProgression



/** Test program for the progression classes */
int main() {
  Progression* prog[6];
					// test ArithProgression
  cout << "Arithmetic progression with default increment:\n";
  prog[0] = new ArithProgression();
  prog[0]->printProgression(10);
  cout << "Arithmetic progression with increment 5:\n";
  prog[1] = new ArithProgression(5);
  prog[1]->printProgression(10);
					// test GeomProgression
  cout << "Geometric progression with default base:\n";
  prog[2] = new GeomProgression();
  prog[2]->printProgression(10);
  cout << "Geometric progression with base 3:\n";
  prog[3] = new GeomProgression(3);
  prog[3]->printProgression(10);
					// test FibonacciProgression
  cout << "Fibonacci progression with default start values:\n";
  prog[4] = new FibonacciProgression();
  prog[4]->printProgression(10);
  cout << "Fibonacci progression with start values 4 and 6:\n";
  prog[5] = new FibonacciProgression(4, 6);
  prog[5]->printProgression(10);
  return EXIT_SUCCESS;			// successful execution
}