#include <cctype>
#include <iostream>
#include <string>
usingnamespace std;
bool dogs_or_cats() // true for dogs, false for cats
{
cout << "Do you prefer dogs or cats? ";
while (true)
{
string s;
cin >> ws; // skip any leading whitespace
getline( cin, s );
if (s.empty()) continue;
switch (toupper( s[ 0 ] ))
{
case'D': returntrue;
case'C': returnfalse;
}
cout << "Yes, but this is only about dogs or cats. Which do you prefer? ";
}
}
int main()
{
if (dogs_or_cats())
cout << "You must be an energetic, fun-loving individual!\n";
else
cout << "You must be an empathetic, caring individual!\n";
return 0;
}