find non-key item in binary search tree

I am creating a menu-driven program which creates a small database using a binary search tree. I am having issues with the last method I need for the program. The way it is coded now only gives me blank data when I print it. Here is the exact wording for the requirements for this method:
"Output a complete report to the text file named BillionaireReports.txt in increasing order by billionaire rank, that contains all data fro each record stored in the BST. Note: this is not a simple traversal. You may assume that the rank is never less than 1 and never greater that 500. Do NOT copy the data into another BST, into an array, into a linked list, or into any other type of data structure. Retrieve the data directly from the binary search tree which is stored in order by name."

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void BillionaireDatabase::displayRankReport()
{
   Billionaire anItem;
   anItem.getRank();
   int i = 1;
   for(i; i <=500; i++)
   {
      billionaireDatabaseBST.contains(anItem);
      if(anItem.getRank() == i)
      {
         anItem.printBillionaire();
      }
   }
      
}


Here are the available functions for the BST:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
   //------------------------------------------------------------
   // Constructor and Destructor Section.
   //------------------------------------------------------------
   BinarySearchTree();
   BinarySearchTree(const ItemType& rootItem);
   BinarySearchTree(const BinarySearchTree<ItemType>& tree);
   virtual ~BinarySearchTree();
   
   //------------------------------------------------------------
   // Public Methods Section.
   //------------------------------------------------------------
   bool isEmpty() const;
   int getHeight() const;
   int getNumberOfNodes() const;
   ItemType getRootData() const throw(PrecondViolatedExcep);
   void setRootData(const ItemType& newData) const throw(PrecondViolatedExcep);
   bool add(const ItemType& newEntry);
   bool remove(const ItemType& anEntry);
   void clear();
   ItemType getEntry(const ItemType& anEntry) const throw(NotFoundException);
   bool contains(const ItemType& anEntry) const;
   
   //------------------------------------------------------------
   // Public Traversals Section.
   //------------------------------------------------------------
   void preorderTraverse(void visit(ItemType&)) const;
   void inorderTraverse(void visit(ItemType&)) const;
   void postorderTraverse(void visit(ItemType&)) const;

   //------------------------------------------------------------
   // Overloaded Operator Section.
   //------------------------------------------------------------
   BinarySearchTree<ItemType>& operator=(const BinarySearchTree<ItemType>& rightHandSide);


If you need more code just let me know.
Topic archived. No new replies allowed.