AP Computer Science Principles
An if-else statement is a programming construct that allows the program to make decisions based on a condition. It consists of an if block and an else block, where the code inside the if block is executed when the condition evaluates to true, and the code inside the else block is executed when the condition evaluates to false.