/******************************************************************************************
person.cpp
******************************************************************************************/
#include "person.h"
#include <string>
#include <fstream>
using namespace std;



//------- return the count of records where state matches the token ------
int TallyByState(string token, person list[], const int size) {
    int count = 0;
    for (int i = 0; i < size; i++)
        if (list[i].state == token)
            count++;
    return count;
}

//------- fill each person in the list from a file ------
void readFile(string filename, person people[], const int maximum, int& size) {
    ifstream fin(filename.c_str());
    for (int i=0; i < maximum; i++) {
        if(fin >> people[i].first >> people[i].last >> people[i].state)
            size++;
    }
}