View Single Post
Old 02-20-2006, 02:30 PM   #2 (permalink)
feelgood
Free Mars!
 
feelgood's Avatar
 
Location: I dunno, there's white people around me saying "eh" all the time
When posting crapload of code like that, format it properly using [ code ] tags

You don't need a ; at the end of the if statement line

if (hoursworked > standardhours);<---

Code:
	if (totalsales < 100 && totalsales > 1.00); {
	{
		comission = totalsales * .05;
	}
	else if	{
	(totalsales >= 100 && totalsales < 300);
	{
		totalsales * .10 = comission;
	}
	else
	(totalsales >=300)

	comission = totalsales * .15;
	}
	}
You have a really bad nested statement here, I would suggest you to look at it closer and figure out where the brackets needs to be and where the condition check statement should be. That should solve your problem. A proper nested statement would look like this:

Code:
	if(something=0)
	{
		something here;
	}
	else if(something<0)
	{
		something here;
	}
	else
	{
		something here;
	}
__________________
Looking out the window, that's an act of war. Staring at my shoes, that's an act of war. Committing an act of war? Oh you better believe that's an act of war

Last edited by feelgood; 02-20-2006 at 02:32 PM..
feelgood is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62