/**
 * A simple example that uses multiple nested if statements
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class IfExample3
{
    public static void main(String[] args)
    {
       int       years;
       String    title;

       years = 1;
       title = "Freshman";


       // Missing code (to determine years)


       //[0    Multiple nested if statements (one style)
       if (years <= 1) title = "Freshman";
       else if  (years <= 2) title = "Sophomore";
       else if  (years <= 3) title = "Junior";
       else title = "Senior";
	
       //]0


       //[1    Multiple nested if statements (another style)
       if (years <= 1)
       {
          title = "Freshman";
       }
       else
       {
          if  (years <= 2) 
          {
             title = "Sophomore";
          }
          else 
          {
             if  (years <= 3) 
             {
                title = "Junior";
             }
             else 
             {
                title = "Senior";
             }
          }
       }

       //]1
    }

}
