← Back to CoursesComputer Science: Beginner

Neuroanatomy Explorer

Drag to rotate · scroll to zoom · click regions to explore

View
Loading 3D model…

Click a region
to explore it

Memory Deck

Flip each card and rate whether you knew it. Your score is saved.

Term
Definition

Deck complete — score saved.

Match the Pairs

Match each term to its definition. Finish the board to earn your score.

All matched — score saved.

Concept Constellation

Every key idea in this course, mapped as an explorable 3D constellation. Drag to rotate, scroll to zoom, click a node.

Click a node to read its definition.

Conditionals: Making Decisions

Manual: General · Subject: Computer Science

Learn how programs choose different actions using if-statements and logical conditions.

Programs that choose

If statements

A program often needs to make decisions. A conditional says, in effect, if this condition is true, then do this; otherwise do something else.

Simple decision flow

  1. 1

    Step 1: Check a condition.

  2. 2

    Step 2: If it is true, run one set of instructions.

  3. 3

    Step 3: If it is false, run a different set of instructions.

💡

Conditions are questions

A condition is usually a yes/no question such as is the temperature above 20? or is the password correct?

What does a conditional help a program do?

What is the result of a condition being true?

True branch vs false branch

True branch

  • Runs when the condition is satisfied
  • Represents one possible path

False branch

  • Runs when the condition is not satisfied
  • Represents the alternative path

Which of these is a yes/no condition?

Give an example of a real-life decision a program could make.