View Single Post
Old 08-11-2012, 03:40 AM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yes, but you won't receive any output. You haven't specified a set of branch evaluations that actually lead to any useful processing or output, so it performs no tasks when run.
Look at your branch statements. You have this:
Code:
if (salesTotal < 10000) // this is true
{ 
    if (salesClass == 1) // this is false
    {
    }
    // you are here.
}
else if (salesClass == 2) // will never get here.
{
    // output
}
Look at where you are there. Since there is no satisfied condition it abandons the inner branch and returns to the outer branch. The outer branch provides no else, so it has no condition to satisfy and continues processing. There is no following instruction.

The only way you will ever get output in this is if salesClass is set to 2.
Fou-Lu is offline   Reply With Quote