Hello everyone, I'm having some trouble with a program with this description:
Write a program that prompts the user to enter a name, searches a file (teacherlist.txt) for that name, and outputs to the screen the teacherís name and room number. .
Note that I already have a huge text file filled with names and room numbers. If you would like to see it, i will be glad to show you.
Basically, i have some code down, though for the most part I am lost. If anyone could guide me a bit, i would truly appreciate.... im not sure how to go about this at a....
*This is what i have so far...
int a, name_length, count;
// Opens the teacherlist.txt file
cout << "Enter in the teacher's last name to obtain room information" << endl;
cin >> find_teacher;
name_length = find_teacher.length();
for(int i=0; i<name_length; i++)
cout << find_teacher[i] << endl;
// Sets All array slots to 0
/* Sets Count to zero so it can be used to find whether or not i have found the
name or not */
// Since it found a letter that doesn't match, it tries a new line
// The file marker does not go back to the beginning of the File
Any help would be great... THank you all in advance for even reading such a post.