Hello, I have been trying for a few hours to create a program that counts the number of letters in the ten words that are provided, not including spaces. I am completely lost and any help would be greatly appreciated. I feel like I am missing an extremely simple detail.
// counts the number of total letters in the 10 words the user entered
// created by ***********
#include <iostream>
usingnamespace std;
int main()
{
int wordsAllowed = 10;
cout << "Please enter " << wordsAllowed << " numbers below. One per line. " << endl;
int wordsEntered = 0;
string word;
int i = word.size();
while(wordsEntered < wordsAllowed)
{
cout << "---> " ;
cin >> word;
int i = i + word.size();
++ wordsEntered;
}
cout << "There are " << i << " letters in total.";
}