|
| 1 | +#include "Progression.h" |
| 2 | +#include "ArithProgression.h" |
| 3 | +#include "GeomProgression.h" |
| 4 | +#include "FibonacciProgression.h" |
1 | 5 | #include <iostream> |
2 | 6 |
|
3 | 7 | using namespace std; |
4 | 8 |
|
5 | 9 | int main(int argc, char const *argv[]) { |
| 10 | + Progression* prog; |
6 | 11 |
|
| 12 | + // test Progression |
| 13 | + cout << "Base progression with default increment:" << endl; |
| 14 | + prog = new Progression(); |
| 15 | + prog->printProgression(10); |
| 16 | + cout << "Base progression with increment 5:" << endl; |
| 17 | + prog = new Progression(5); |
| 18 | + prog->printProgression(10); |
| 19 | + cout << endl; |
| 20 | + |
| 21 | + // test ArithProgression |
| 22 | + cout << "Arithmetic progression with default increment:" << endl; |
| 23 | + prog = new ArithProgression(); |
| 24 | + prog->printProgression(10); |
| 25 | + cout << "Arithmetic progression with increment 5:" << endl; |
| 26 | + prog = new ArithProgression(5); |
| 27 | + prog->printProgression(10); |
| 28 | + cout << endl; |
| 29 | + |
| 30 | + // test GeomProgression |
| 31 | + cout << "Geometric progression with default base:\n"; |
| 32 | + prog = new GeomProgression(); |
| 33 | + prog->printProgression(10); |
| 34 | + cout << "Geometric progression with base 3:\n"; |
| 35 | + prog = new GeomProgression(3); |
| 36 | + prog->printProgression(10); |
| 37 | + cout << endl; |
| 38 | + |
| 39 | + // test FibonacciProgression |
| 40 | + cout << "Fibonacci progression with default start values:\n"; |
| 41 | + prog = new FibonacciProgression(); |
| 42 | + prog->printProgression(10); |
| 43 | + cout << "Fibonacci progression with start values 4 and 6:\n"; |
| 44 | + prog = new FibonacciProgression(4, 6); |
| 45 | + prog->printProgression(10); |
| 46 | + cout << endl; |
| 47 | + |
7 | 48 | return 0; |
8 | 49 | } |
0 commit comments