I have a program that reads from a file, and inserts the read items into a template array. Once that file is read into the array the second file is read, if there is a invald name ie name not int the array it is not updated. The second file is just a list of scores in a game and the winner's record is incremented if won or loss incremented if loss

This is what the first file looks like

Hawks 6 3 83
Doves 7 2 27
Goofs 1 8 13
Donkeys 5 0 37

Here is the second file

Hawks 21 Goofs 0
Doves 35 Hawks 27
Goofs 14 Chickens 14

If you see the seconod file is just scores between two oppenents a line is invalid if the team is a tie or invalid team that is not in the array, if everything is valid I need to update the total points win and loss record for corresponding team

I already have the error checking
I just need to make a function in my class that is being passed to the template array so the the win and loss and scores a incremented correspondingly for a said team in the template array

here is a list of functions in the template class that I have that I am trying to make use of

#ifndef H_arrayListTypeT
#define H_arrayListTypeT
// Templated version of the arrayListType
template<class elemType>
class arrayListTypeT
{
public:
    bool isEmpty() const;
    bool isFull() const;
    int  listSize() const;
    int  maxListSize() const;
    void print() const;
    bool isItemAtEqual(int location, elemType item) const;
    void removeAt(int location);
    void retrieveAt(int location, elemType& retItem);
    void replaceAt(int location, elemType repItem);
    void clearList();
    int  seqSearch(elemType item) const;
    void insert(elemType insertItem);
  
    void remove(elemType removeItem);
    // Postcondition:
    // Standard error checking is performed. If there are no errors,
    // the item is removed from the list, all subseguent items are moved 
    // forward to fill the gap, and the length is decremented by one.
    arrayListTypeT(int size = 100);
    arrayListTypeT (const arrayListTypeT& otherList); 
    ~arrayListTypeT();

protected:
    elemType *list;    //array to hold the list elements
    int length;        //variable to store the length of the list
    int maxSize;       //variable to store the maximum 
                       //size of the list
};
#endif
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.