I want to write a program.This program is following:

The two text file named file1and file2 each hold number of English sentences.A c++ program is required to carry out the following operations.
a.)Give a wrod ,it lists how many times that word appears in file1 and file2.
b.)list all the words that occur in both file1 and file2.
c.)list all the words that occur in file1 but not in file2.
d.)To print a list where the words appear in alphabetical order.
e.)It is assumed that all the words are in lower case character,space character the words and each sentence is terminated by a full stop.

Please help me for this program. How to write a files.