First: you are trying to read birthmonth and birthday twice?
For std::string's you should use std::getline() and remember that it can read just one string at a time:
1 2 3 4
// good
std::getline(std::cin, birthmonth);
std::getline(std::cin, birthday);
// bad
std::cin >> birthmonth, birthday;
getline(cin, birthmonth,birthday);
Second: you can't use the logical or operator to "shortcut" the comparison like that.
By doing what you did, the string literal "November" becomes a standalone true condition.
Also you must remove the semicolon after the if(), which counts as an empty instruction (meaning that the std::cout is outside the if() and will always print).
1 2 3 4
// good
if (birthmonth == "October" || birthmonth == "November" && birthday <= 23)
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
1 2 3 4 5
// bad
if (birthmonth == "October" || "November"
&& birthday <= 23);
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
Edit: also, I just noticed that you're comparing birthday against a number. You can't do that without first converting one to another.
This code contain many errors both compile time and logic error. Also the program forces the user to type a correct choice with may introduce.
Here are a few ways to correct your code
1 2 3 4 5 6 7 8 9 10 11
string birthmonth;
int birthday;
std::cout << "Please enter your month of birth and day of birth, thank-you" << endl << endl;
std::cin >> birthmonth >> birthday;
if (birthmonth == "October" || "November"
&& birthday <= 23);
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
or
1 2 3 4 5 6 7 8 9 10 11
string birthmonth;
string birthday;
std::cout << "Please enter your month of birth and day of birth, thank-you" << endl << endl;
std::cin >> birthmonth >> birthday;
if (birthmonth == "October" || "November"
&& birthday <= "23");
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
or
1 2 3 4 5 6 7 8 9 10 11 12
string birthmonth;
int birthday;
std::cout << "Please enter your month of birth and day of birth, thank-you" << endl << endl;
getline(cin, birthmonth);
std::cin >> birthday;
if (birthmonth == "October" || "November"
&& birthday <= 23);
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
or
1 2 3 4 5 6 7 8 9 10 11 12
string birthmonth;
string birthday;
std::cout << "Please enter your month of birth and day of birth, thank-you" << endl << endl;
getline(cin, birthmonth);
getline(cin, birthday);
if (birthmonth == "October" || "November"
&& birthday <= "23");
std::cout << "Your astrological sign is in the origin of Scorpio" << endl << endl;
I appreciate the quick response from everybody and the great participation. i have taken everyone's corrections and i am still compiling errors please continue the help
getline only works on strings, not ints. Since, a month may not consist of more than one word, using operator>> would probably be simpler. Btw, the misplaced semi-colon is still there.