Please don't ask us to do your homework. If you have tried, then show your code and we'll help.
I'll give a clue:
first create a file with some text(remember to use "the").
second, open it using an ofstream or ostream object.
third, use get() get the contents of the file byte by byte.
fourth, compare the obtained values with 't', 'h' and 'e' one by one in a if statements.
Please be more specific as to what you are having difficulties with. Is it opening the file, counting the words? Do you have any code so far?
If you need help getting started:
You need to create a string which will temporarily hold the words of the file as well as a counter variable. Then, open the file and read word for word into the temporary string until the end of the file. While doing so, check if the word is "the" and if so, increment the counter.
That actually holds a lot of hints in there. Please do let us know if you require any further help.
Edit: Using std::ifstream::operator>>() you can read in word for word, rather than byte for byte as The illusionist mirage suggested.