I am changing all of my posts bc someone in my class copied and pasted my entire code last time...cheating off of hours of work I put in.
Printable View
I am changing all of my posts bc someone in my class copied and pasted my entire code last time...cheating off of hours of work I put in.
adfsf
I don't believe you want a loop but an if statement. Your while loop is governed by the following test:
But none of those are updated within the loop so once it enters the loop it will loop forever.Code:annualSales >= salesIncentCalc || annualSales <= salesTarget
Jim
Thank you for that. How would I write it so it knows it's between 96,000 (salesIncentCalc) and 120,000 (salesTarget)?
adfa
Well, assuming I understand what you are trying to do you would need three condition tests:
Regards,Code:if (AnnualSales >= 96000 && AnnualSales <= 120000) { // between the two inclusive
// do something at 25%
} else if (AnnualSales < 96000) {
// do something else at 0%
} else { // at this point AnnualSales must be > 120000 so
// do something here at 31.25%
}
Jim
asdf
Nevermind, I figured it out thanks to your advice. I seriously couldn't have done it if it wasn't for you. Thank you so much for taking the time to help me.
Very appreciated :)
That is not advisable. I am not a moderator but it is my experience that it is not permitted to delete your posts. They will probably be restored. It is my opinion that any code posted in this forum becomes public domain and may be used by anyone. After all, this is a forum for learning. When it comes to homework and other related assignments, honor codes prevail.
Regards,
Jim