Structure Decision for If Statement

CS1 / Java


  • Wei Jin Georgia Gwinnett College


Very often there are several ways to solve a problem that requires the use of an if statement. This activity is designed to help students become familiar with this issue and make decisions to choose the best structure in terms of both correctness and code efficiency. Students should have learned Boolean expressions. Students should also have learned the syntax of if statements, including single-branch if statements, if-else statements, and multi-branch if statements. (This activity can also be used to introduce if statements as long as adequate time is allocated.)

This activity was developed with NSF support through IUSE-1626765. You may request access to this activity via the following link: IntroCS-POGIL Activity Writing Program

Level: Undergraduate
Setting: Laboratory
Activity Type: Learning Cycle
Discipline: Computer Science
Course: CS1 / Java
Keywords: if statement




How to Cite

Jin, W. (2023). Structure Decision for If Statement: CS1 / Java. POGIL Activity Clearinghouse, 3(4). Retrieved from



CS-POGIL Activity Writing Program