If you enter a value for the month and day that is greater than 1, the if statement will always execute. To fix this, you should start the if-else conditions in decending order like so:
1 2 3 4 5 6 7 8
if (month > 7 && day > 7)
cout << "you have missed the deadline!\n";
elseif (month > 6 && day > 22 || month < 7 && day < 7)
cout << "you owe $350 dollars.\n";
elseif (month > 4 && day > 21 || month < 6 && day < 21)
cout << "you owe $300 dollars!\n";
elseif (month > 1 && day > 1 || month < 4 && day < 20)
cout << "you owe $250 dollars.\n";
You need to take into account that, for example, January 31 is "less than" April 1. So something like month < 4 && day < 20 Will fail for days larger than 20, even when the month is less than 4. So I think you want something like:
1 2 3 4 5 6 7 8 9
if (month < 3 || month == 3 && day < 20) { // before March 20
cout << "you owe $250 dollars." << endl;
} elseif (month < 5 || month == 5 && day < 21) { // before May 21
cout << "you owe $300 dollars!" << endl;
} elseif (month < 6 || month == 6 && day < 7) { // before June 7
cout << "you owe $350 dolalrs." << endl;
} else {
cout << "you have missed the deadline!" << endl;
}
Sometimes it's better to use data than code. Here is another way that uses an array to encode the deadlines and amounts. The advantage is that it's much easier to add or change a deadline: