I need to update this code:
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
string s;
cout<< “Enter a string” <<endl;
getline (cin,s);
cout<< s <<endl;
int vowels=0,consonants=0,digits=0,specialChar=0;
for (int i=0; i<s.length(); i++) {
char ch=s[i];
if (isalpha(s[i])!= 0){
s[i]= toupper(s[i]);
if (ch == ‘a’|| ch == ‘e’|| ch == ‘i’|| ch == ‘o’ || ch ==’u’)
vowels++;
else
consonants++;
}
else if (isdigit(s[i])!= 0)
digits++;
else
specialChar++;
}
cout<<“Vowels=”<<vowels<<endl;
cout<<“Consonants=”<<consonants<<endl;
cout<<“Digits=”<<digits<<endl;
cout<<“SpecialCharacters=”<<specialChar<<endl;
return 0;
}
so that it accomplishes everything below:
Read your string from an input file instead of from the user
Need it to refernce a a file named “words.txt”
Remove the call to getUserInput. You can also remove its definitionand prototype if you like.
Then have it process all of the words in the file, not just
PayPal Gateway not configured
PayPal Gateway not configured