1 |
//Jeremy Drake
|
2 |
//Period 2
|
3 |
//AdviceTree
|
4 |
|
5 |
#include <iostream.h>
|
6 |
#include <apstring.h>
|
7 |
#include "adtree.h"
|
8 |
|
9 |
int main()
|
10 |
{
|
11 |
AdTree c;
|
12 |
apstring a;
|
13 |
c.BuildTheDamnTree();
|
14 |
c.GiveAdvice(NULL);
|
15 |
apstack<apstring> foo;
|
16 |
c.TracePath(NULL, "Jaws", foo);
|
17 |
cout << "-------------------------------------------"<<endl;
|
18 |
while(!foo.isEmpty())
|
19 |
{
|
20 |
foo.pop(a);
|
21 |
cout << a << endl;
|
22 |
}
|
23 |
return 0;
|
24 |
}
|
25 |
|
26 |
/*******************************************************************************
|
27 |
* Output:
|
28 |
* Do you want to see a romantic movie? y
|
29 |
* A classic movie? n
|
30 |
* Titanic
|
31 |
* -------------------------------------------
|
32 |
* Do you want to see a romantic movie? No
|
33 |
* Science Fiction? No
|
34 |
* Suspense? Yes
|
35 |
* Jaws
|
36 |
******************************************************************************/
|