/** 11. Write a C++ program that changes the first letter of each word in an input sentence to upper case (if they are not already upper case) and prints a period at the end of the last word unless there is already a period there. **/ #include #include using namespace std; /* Format a sentence by capitalizing the first letter of all words and ending the sentence with a period. You can close console input stream in Unix systems by typing Ctrl-D */ int main() { string a[30],b,last; int i=0,count,length; cout<<"Enter a line\n"; //Read in the string while (cin>>b){ a[i]=b; i++; } count=i; //Capitalize first letter of each word for(int j=0; j