//Read in name and year born from a file #include #include using namespace std; int main(void) { double num, total=0; char name[15]; int yearborn, age,count=0; ifstream people; //input file stream people.open("c:/mycpp/names.txt"); //associates numbers with file if (people.fail()) //maybe the file doesn't exist, or protected cout<<"File error\n"; //cout is used to notify user of error else { cout<<"NAME\tAGE\n"; //heading people>>name; //read first before loop! while (!people.eof()) { //eof=end of file people>>yearborn; age=2014-yearborn; cout<>name; //read next name count++; } //while not end of file people.close(); cout<