/* Title: Name Fixer Author: Vanessa Schagerer Date: 9/20/07 Description: Takes user input name and changes it to be written correctly with only the first letter capitalized and the rest lower case. */ #include using namespace std; int main() { char ch, cont = 'y'; while(cont == 'Y' || cont == 'y') { cout << "Please enter your name: \n"; cin.get(ch); if('a' <= ch && ch <= 'z') { ch = ch - ('a' - 'A'); } cout << ch; cin.get(ch); while(ch != ' ') { if('A' <= ch && ch <= 'Z') { ch = ch + ('a' - 'A'); } cout << ch; cin.get(ch); } cout << ' '; cin.get(ch); if('a' <= ch && ch <= 'z') { ch = ch - ('a' - 'A'); } cout << ch; cin.get(ch); while(ch != '\n') { if('A' <= ch && ch <= 'Z') { ch = ch + ('a' - 'A'); } cout << ch; cin.get(ch); } cout << '\n'; cout << "Would you like to enter another name? (Y/N) "; cin >> cont; cin.get(ch); } return 0; }