/**
 * An example that demonstrates the use of debug output statements
 * with conditionals.
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class DebuggingConditionals
{
    /**
     * The entry point.
     *
     * @param args  The command line arguments
     */
    public static void main(String[] args)
    {
        char sex    = 'M';        
        int  height = 62;
        
        JMUConsole.open();
        
        //[0
        // For debugging
        JMUConsole.printf("Before: height(%d) sex(%c)", height, sex);
        JMUConsole.printf("        (height >= 62)  %s)",(height>=62));
        JMUConsole.printf("        (sex == 'M')    %s)",(sex=='M'));

        if ((height >= 62) && (sex == 'M')) 
        {
            // For debugging
            JMUConsole.printf("In if-block: height(%d) sex(%c)", height, sex);

            // ...
        }
        else 
        {
            // For debugging
            JMUConsole.printf("In else-block: height(%d) sex(%c)", height, sex);

            // ...
        }
        // For debugging
        JMUConsole.printf("After: height(%d) sex(%c)", height, sex);
        //]0
        
        JMUConsole.close();
    }
}
