//Read file of name and year born. Print name and age #include #include #include #include using namespace std; int currentYear() { return time(0) / 60 / 60 / 24 / 365 + 1970; } //currentYear int readfile(ifstream &people,string names[],int years[]) { int count=0; people>>names[count]; //read first before loop! while (!people.eof() && count<20) { //eof=end of file people>>years[count]; count++; if (count<20) people>>names[count]; //read next name } //while not end of file people.close(); return count; } //readfile void printAll(string names[],int years[], int count) { int age; int year=currentYear(); //call it just once! cout<<"NAME\tAGE\n"; for(int i=0; i