There are a couple of issues here:
Instead of using a string to store an answer, just use a char. It will be simpler when comparing everything.
When you do compare chars, use a single apostrophe instead of quotation marks.
there is a function which translates uppercase to lower case, and it is called
int tolower(int)
http://cplusplus.com/reference/cctype/tolower/
When the user responds, try using this to lower the case so you don't need to check for both conditions.
Once you use tolower, you won't need to check for both conditions anymore, but just so you know, when checking for multiple conditions you must explicitly write the condition for each check. so:
becomes
|
if (answer1 == 'a' || answer1 == 'A')
|
You don't need to use getline here:
just use cin:
whats happening is that getline gets all of the chars in the line, including the newline character that gets inputted.