Lesson 11 - Activity 1 - Multiple conditions

Time: 15 minutes

Purpose: This activity helps you get familiar with multiple conditions

Introduction: Youโ€™re had experience using a single if condition, try and use one which uses multiple conditions

Task: Modify the existing code so that it now applies to people who are not only over 18, but also under 30.

   public static Boolean eligibleByAge (int age) {
        Boolean eligible = Boolean.FALSE;
        if ((age >= 18) && (age < 30)){
            eligible = Boolean.TRUE;
        }
        return eligible;
    }

Good work there. That works!