{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "54c168de",
   "metadata": {},
   "source": "```{index} statement; if if\n```\n\n(if-statements)=\n\n# Conditionals\n\n<!-- chapter-intro -->\n\nPrograms need to make decisions. This chapter introduces the core decision-making constructs in C#: `if`, `else if`, `else`, `switch`, and the boolean expressions that drive them.\n"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "id": "e76e085f",
   "source": "<h2>Why this chapter matters</h2>\n\nA program that always does the same thing regardless of its inputs has limited value. Conditionals unlock real behavior:\n\n- validate user input before using it\n- pick the right code path for each situation\n- express business rules such as grade cutoffs or access levels\n- combine multiple conditions with `&&`, `||`, and `!`\n"
  },
  {
   "cell_type": "markdown",
   "id": "61dfad92",
   "metadata": {},
   "source": "<h2>Learning goals</h2>\n\nBy the end of this chapter, you should be able to:\n\n- write `if`, `else if`, and `else` chains correctly\n- construct boolean expressions using comparison and logical operators\n- handle multiple exclusive cases with a `switch` statement\n- avoid common pitfalls: dangling else, off-by-one comparisons\n\n<h2>Chapter flow</h2>\n\n```{tableofcontents}\n```\n"
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}