I have been having various issues trying to figure out a very trivial problem. I've re-written this code now several times and used many different condition statements etc... One issue that i'm having right now is the input for the variable "paragraph" not being available, the paragraph input is skipped and thus the rest of the code skipped, amongst many other things. I haven't added everything yet because i'm still trying to work out the issues mentioned above.
cout << "\nWould you like to continue? 'y' for yes and 'n' for no...\n";
cin.get(response);
while ((response != 'n') || (response != 'N'))
{
while ((response != 'y') && (response != 'Y') && (response != 'n') && (response != 'N'))
{
cin.clear();
cin.sync();
cout << "\nInvalid response, would you like to continue?" << endl;
cin >> response;
}
cout << "\nEnter a paragraph press 'enter' when done:\n";
getline(cin,paragraph);
nonblank = paragraph.length();
uppercase = 0;
lowercase = 0;
while (count <= nonblank)
{
if (paragraph >="A" && paragraph <="Z")
{
uppercase += 1;
}
count++;
}
while (count <= nonblank)
{
if (paragraph >="a" && paragraph <"z")
{
lowercase += 1;
}
count++;
}
nonblank = uppercase + lowercase;
cout << "\nThe number of uppercase letters is "<< uppercase << endl;
cout << "\nThe number of lowercase letters is "<< lowercase << endl;
cout << "\nThe number of nonblank characters is "<< nonblank << endl;
cout << "\nWould you like to continue?\n";
cin.get(response);
("cls");
}
return 0;//checks if program executed correctly
}//end function main
}//end function main