I hope some one can help me how to modifey this program, and make it better , i just need some one to answer my question by the codes.
i am trying to make simple chat on the council . and need answers on my below questions .
int main ()
{
string mystr;
cout << "WHAT IS YOUR NAME? " << endl; // print question on screen.
getline (cin, mystr); //user input.
cout << "HELLO " << mystr << endl; //welcome output.
cout <<"IS SAM YOUR SON? PLEASE TYPE y/n " << endl;
char answer;
cin >> answer;
if (answer=='y') //if the user type y.
{cout << "YOU ARE LUCKY.. HE IS SMART BOY. " << endl;
cout << " CAN I MEET HIM TODAY ? " << endl;
char response;
cin >> response;
return 1;
}
if (answer=='n'); //if the user type n.
{
cout << " DO NOT LIE .. YOU FORGOT THAT I AM COMPUTER !. "<<endl;
}
system("pause");
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
and my questions are :
1- when the user type the answer in lowercase i want it to show in uppercase .
2 if the user reply on first question ( mystr ) by (my name is Tom) how not to show the ( my name is ) and keep his name in the welcome screen.(next line).
3- how to change (y/n) to (yes / no ) .
4 if the user did not type yes/no how to print msg ( unexpected result ).