I'm trying out strings and I wanted to add an if else statement to it. Here is my code so far. I have no idea how to include if else, so I haven't done it yet.
int main()
{
string team;
cout << "What's your name?";
getline (cin, team);
cout << "Hello, " << team << ".\n";
Sleep(2300);
cout << "What is your favourite soccer team?\n";
getline (cin, team);
cout << team << " is a great team!\n";
Sleep(2800);
cout << "Are they in first place? Answer yes or no.";
_getch();
}
Now, after the cout << "Are they in first place?"; line, I want to add an if else statement to basically say if the user says "yes" to write "That's great!" and if the user says no, I want it to say "Oh, I'm sorry to hear that!"