Using a text editor (i.e. Notepad), create a text file called Text1.txt and place it into a folder of your choosing.
Fill Text1.txt with a sentence and save the file.
Then, write a C++ program that performs the following:
1. Reads the sentence from the file Text1.txt and display it on the screen.
2. Asks the user to enter a lowercase letter (a-z) with the keyboard.
3. Count and display the number of times that the entered letter appears in the sentence read from the file.
THIS IS WHAT I HAVE SO FAR!!!!!!
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
using namespace std;
int main()
{
ifstream inFile ("d:/Text1.txt", ios::in);
char sentence[80];
if(!inFile)
{
cerr<<"File Text1.txt could not be opened"<<endl;
exit(1);
}
inFile.getline(sentence,80);
cout<<endl;
cout<<"The file Text1.txt contains the following sentence:";
cout<<endl;
cout<<sentence;
inFile.close();
cout<<endl;
cout<<"Please enter a lowercase letter between (a-z):";
char letter;
cin>> letter;
return 0;
}