In: Computer Science
ReDo the example problem to include other populations, not just those who are female and more or less mature. What student populations will you need to account for? How many are really just sub-sets of other populations? What will you name the groups to 1) Be more verbally inclusive to populations, and 2) Provide meaning to coders that come months / years after you have?
IF student_attendance = part_time THEN
   IF student_gender = female THEN
     IF student_age > 21 THEN
         add 1 to
mature_female_pt_students
     ELSE
         add 1 to
young_female_pt_students
      ENDIF
   ELSE
    add 1 to male_pt_students
    ENDIF
ELSE
   add 1 to full_time_students
ENDIF
Edit the above example to include more populations (other types of students other than part time females) Please help with an example(s)!
Following are the updates which are done in the above given
IF student_attendance = part_time THEN
       IF student_gender = female THEN
             IF student_age > 42 THEN
                 add 1 to old_female_pt_students
             ELSE IF student_age > 21 THEN
                 add 1 to mature_female_pt_students
             ELSE
                 add 1 to young_female_pt_students
             ENDIF
       ELSE
            IF student_age > 42 THEN
                add 1 to old_male_pt_students
            ELSE IF student_age > 21 THEN
                add 1 to mature_male_pt_students
            ELSE
                add 1 to young_male_pt_students
            ENDIF
       ENDIF
ELSE IF student_attendance = over_time THEN
   IF student_gender = female THEN
         IF student_age > 42 THEN
             add 1 to old_female_ot_students
         ELSE IF student_age > 21 THEN
             add 1 to mature_female_ot_students
         ELSE
             add 1 to young_female_ot_students
         ENDIF
   ELSE
         IF student_age > 42 THEN
            add 1 to old_male_ot_students
         ELSE IF student_age > 21 THEN
             add 1 to mature_male_ot_students
         ELSE
             add 1 to young_male_ot_students
         ENDIF
   ENDIF
ELSE
   IF student_gender = female THEN
         IF student_age > 42 THEN
             add 1 to old_female_ft_students
         ELSE IF student_age > 21 THEN
             add 1 to mature_female_ft_students
         ELSE
             add 1 to young_female_ft_students
         ENDIF
   ELSE
        IF student_age > 42 THEN
             add 1 to old_male_ft_students
         ELSE IF student_age > 21 THEN
             add 1 to mature_male_ft_students
         ELSE
             add 1 to young_male_ft_students
         ENDIF
   ENDIF
ENDIF
That was a nice
question to answer
Friend, If you have any doubts in understanding do let me know in
the comment section. I will be happy to help you further.
Please like if you think effort deserves like.
Thanks