I am having a major problem with such a simple solution:
{
if ((month == 4) && (day >= 1) && (month == 4) && (day <= 31))
penalty = (( day / 30 ) * 400);
else
if ((month == 5) && (day >= 1) && (month == 5) && (day <= 31))
penalty = ((( day / 30 ) * 400) + 400);
else
if ((month == 6) && (day >= 1) && (month == 6) && (day <= 31))
penalty = ((( day / 30 ) * 400) + 800);
}
For some odd reason I cannot have the program provide the correct calculation when I enter the correct varibles. If I satisfy any of the above arguments it calculates an answer of 800 which is the last arguement.
Am I spacing it wrong? Are the if statments contradictory (I don't see how, I think I locked them in place pretty well)? I feel like such an idiot asking this, but its driving me crazy.
I don't want the answer, per the rules, I just want a kick in the head if you will... Maybe that will makes all the pieces fall into place.
Thanks
{
if ((month == 4) && (day >= 1) && (month == 4) && (day <= 31))
penalty = (( day / 30 ) * 400);
else
if ((month == 5) && (day >= 1) && (month == 5) && (day <= 31))
penalty = ((( day / 30 ) * 400) + 400);
else
if ((month == 6) && (day >= 1) && (month == 6) && (day <= 31))
penalty = ((( day / 30 ) * 400) + 800);
}
For some odd reason I cannot have the program provide the correct calculation when I enter the correct varibles. If I satisfy any of the above arguments it calculates an answer of 800 which is the last arguement.
Am I spacing it wrong? Are the if statments contradictory (I don't see how, I think I locked them in place pretty well)? I feel like such an idiot asking this, but its driving me crazy.
I don't want the answer, per the rules, I just want a kick in the head if you will... Maybe that will makes all the pieces fall into place.
Thanks