I need to write a program calculating commission based off this info:
15% commission for the first $2,000.00 sales
20% commission for the next $1,000.00 sales
25% commission for the next $500.00 sales
30% commission for the next $500.00 sales
35% commission for the remaining sales
More often than not when you get negative numbers it means your variable type ran out of room and looped back to the beginning which is usually a negative number.
long double still didnt fix it. do i have it written out correctly?
No you haven't.
1 2
else (sales>4000.00); //error on this line here - can you spot it
commission=(.15*2000.00) + (1000.00*.20) + (500.00*.25) + (500*.30) + ((sales-4000.00)*.35);