<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://staging.moocwiki.org/index.php?action=history&amp;feed=atom&amp;title=English%3ASelection_in_Programming</id>
	<title>English:Selection in Programming - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://staging.moocwiki.org/index.php?action=history&amp;feed=atom&amp;title=English%3ASelection_in_Programming"/>
	<link rel="alternate" type="text/html" href="https://staging.moocwiki.org/index.php?title=English:Selection_in_Programming&amp;action=history"/>
	<updated>2026-08-13T16:04:21Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in MOOCsWiki Staging</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://staging.moocwiki.org/index.php?title=English:Selection_in_Programming&amp;diff=44015&amp;oldid=prev</id>
		<title>Glanz: aiMOOC über GPT aiMOOC Action erstellt</title>
		<link rel="alternate" type="text/html" href="https://staging.moocwiki.org/index.php?title=English:Selection_in_Programming&amp;diff=44015&amp;oldid=prev"/>
		<updated>2026-08-12T10:43:27Z</updated>

		<summary type="html">&lt;p&gt;aiMOOC über GPT aiMOOC Action erstellt&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{T}}&lt;br /&gt;
[[Category:English]]&lt;br /&gt;
[[Category:Selection in Programming]]&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Selection&amp;#039;&amp;#039;&amp;#039; is the part of a program that lets the computer make a decision. Instead of always following the same instructions, the program checks a &amp;#039;&amp;#039;&amp;#039;condition&amp;#039;&amp;#039;&amp;#039; and chooses what to do next. You meet the same idea in everyday life: if it is raining, take a coat; otherwise, leave the coat at home.&lt;br /&gt;
&lt;br /&gt;
In programming, selection is often written with words such as &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;else&amp;#039;&amp;#039;&amp;#039;, and sometimes &amp;#039;&amp;#039;&amp;#039;elif&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;else if&amp;#039;&amp;#039;&amp;#039;. These words create different &amp;#039;&amp;#039;&amp;#039;branches&amp;#039;&amp;#039;&amp;#039; in the program. The branch that runs depends on whether a condition is true or false.&lt;br /&gt;
&lt;br /&gt;
Selection works together with [[English:Sequence in Programming|sequence]] and [[English:Iteration in Programming|iteration]]. Sequence puts instructions in order, selection chooses between paths, and iteration repeats instructions.&lt;br /&gt;
&lt;br /&gt;
[[File:If-Then-Else-diagram.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Learning Goals ==&lt;br /&gt;
&lt;br /&gt;
By the end of this aiMOOC, you should be able to explain how selection changes program flow, write and trace simple if and if-else structures, build useful Boolean conditions, draw decision flowcharts, test boundary cases, find common logic errors, and apply selection to small programs and games.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= How Selection Works =&lt;br /&gt;
&lt;br /&gt;
A program using selection usually follows three steps. First, it gathers or calculates some data. Next, it tests a condition. Finally, it runs one branch when the condition is true and a different branch when the condition is false.&lt;br /&gt;
&lt;br /&gt;
Imagine a game with a door that opens only when the player has a key. The condition could be &amp;#039;&amp;#039;&amp;#039;player has key&amp;#039;&amp;#039;&amp;#039;. If the condition is true, the program opens the door. If the condition is false, the program displays a message such as &amp;quot;You need a key.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=sO4UYCbTxxo|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Boolean Conditions ==&lt;br /&gt;
&lt;br /&gt;
A condition must be something the computer can treat as &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;false&amp;#039;&amp;#039;&amp;#039;. A value with only these two possibilities is called a [[English:Boolean data type|Boolean]] value.&lt;br /&gt;
&lt;br /&gt;
Common comparison operators include:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operator&lt;br /&gt;
! Meaning&lt;br /&gt;
! Example&lt;br /&gt;
! Result&lt;br /&gt;
|-&lt;br /&gt;
| ==&lt;br /&gt;
| equal to&lt;br /&gt;
| score == 10&lt;br /&gt;
| true when score is 10&lt;br /&gt;
|-&lt;br /&gt;
| !=&lt;br /&gt;
| not equal to&lt;br /&gt;
| lives != 0&lt;br /&gt;
| true when lives is not 0&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;&lt;br /&gt;
| greater than&lt;br /&gt;
| temperature &amp;gt; 25&lt;br /&gt;
| true when temperature is above 25&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;&lt;br /&gt;
| less than&lt;br /&gt;
| speed &amp;lt; 50&lt;br /&gt;
| true when speed is below 50&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;=&lt;br /&gt;
| greater than or equal to&lt;br /&gt;
| age &amp;gt;= 13&lt;br /&gt;
| true when age is 13 or more&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;=&lt;br /&gt;
| less than or equal to&lt;br /&gt;
| points &amp;lt;= 100&lt;br /&gt;
| true when points is 100 or less&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Be careful with the difference between &amp;#039;&amp;#039;&amp;#039;assignment&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;comparison&amp;#039;&amp;#039;&amp;#039;. In languages such as Python, a single equals sign assigns a value, while two equals signs compare values.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== AND, OR, and NOT ==&lt;br /&gt;
&lt;br /&gt;
You can combine simple conditions to make more precise decisions.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AND&amp;#039;&amp;#039;&amp;#039; is true only when all connected conditions are true. For example, a game might unlock a level when the player has a key AND has at least 50 points.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;OR&amp;#039;&amp;#039;&amp;#039; is true when at least one connected condition is true. A club website might allow entry when a person is a member OR has a guest pass.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; reverses a Boolean value. If &amp;#039;&amp;#039;&amp;#039;is_locked&amp;#039;&amp;#039;&amp;#039; is true, then &amp;#039;&amp;#039;&amp;#039;NOT is_locked&amp;#039;&amp;#039;&amp;#039; is false.&lt;br /&gt;
&lt;br /&gt;
[[File:Truth table for AND, OR, and NOT.png|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= If Statements =&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;if statement&amp;#039;&amp;#039;&amp;#039; runs a block of code only when its condition is true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
temperature = 28&lt;br /&gt;
&lt;br /&gt;
if temperature &amp;gt; 25:&lt;br /&gt;
    print(&amp;quot;It is warm.&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the temperature is 28, the message is shown. If the temperature is 25 or lower, the program skips that indented instruction.&lt;br /&gt;
&lt;br /&gt;
Selection does not have to use numbers. A program could compare text, check a Boolean variable, or test whether an object has reached a position.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== If-Else Statements ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;if-else statement&amp;#039;&amp;#039;&amp;#039; provides two paths. One path runs when the condition is true, and the other runs when it is false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
age = 13&lt;br /&gt;
&lt;br /&gt;
if age &amp;gt;= 13:&lt;br /&gt;
    print(&amp;quot;Age 13 or over&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Child ticket&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two branches should represent clear alternatives. In this example, every possible age goes into one of the two branches, although a real ticket system might add more age groups.&lt;br /&gt;
&lt;br /&gt;
[[File:C language if else.png|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
The image uses the C programming language, but the same decision pattern appears in many programming languages.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=9voVsvd-0v8|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== More Than Two Choices ==&lt;br /&gt;
&lt;br /&gt;
Sometimes a program needs more than two possible outcomes. Python can use &amp;#039;&amp;#039;&amp;#039;elif&amp;#039;&amp;#039;&amp;#039; to test another condition after the first condition is false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
score = 74&lt;br /&gt;
&lt;br /&gt;
if score &amp;gt;= 90:&lt;br /&gt;
    print(&amp;quot;Gold&amp;quot;)&lt;br /&gt;
elif score &amp;gt;= 70:&lt;br /&gt;
    print(&amp;quot;Silver&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Bronze&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of conditions matters. The program checks from top to bottom and uses the first branch whose condition is true. This means broad conditions placed too early can prevent more specific branches from ever running.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Flowcharts for Selection =&lt;br /&gt;
&lt;br /&gt;
A [[English:Flowchart|flowchart]] is a visual way to represent an algorithm. A decision is commonly shown with a diamond. One path leaves the diamond for one result, such as true or yes, and another path leaves it for the other result, such as false or no.&lt;br /&gt;
&lt;br /&gt;
[[File:Flowchart Decision.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
Before coding, a flowchart can help you check whether every important outcome has a path. It can also make missing cases easier to notice.&lt;br /&gt;
&lt;br /&gt;
For example, imagine a program that recommends what to do after school. A decision could ask, &amp;quot;Is homework finished?&amp;quot; The yes branch could suggest a hobby. The no branch could suggest finishing the homework first.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Nested Selection =&lt;br /&gt;
&lt;br /&gt;
A selection statement can appear inside another selection statement. This is called &amp;#039;&amp;#039;&amp;#039;nested selection&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Suppose a school game first checks whether a player has enough points. If the player does, it then checks whether the player has a special badge. The second decision happens only after the first condition is true.&lt;br /&gt;
&lt;br /&gt;
Nested selection can solve complex problems, but too many levels can make code difficult to read. Sometimes a combined condition using AND or OR can express the same idea more clearly.&lt;br /&gt;
&lt;br /&gt;
[[File:Flowgorithm Nested Conditions.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Selection in Games and Apps =&lt;br /&gt;
&lt;br /&gt;
Selection makes programs interactive. It can control whether a character jumps, whether a password is accepted, whether a quiz answer earns a point, whether a warning appears, or whether a game changes level.&lt;br /&gt;
&lt;br /&gt;
In a block-based environment such as [[English:Scratch (programming language)|Scratch]], an if block can check touching, key presses, scores, timers, or variable values. In text-based languages such as Python, the same idea is written with indentation and keywords.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=D5fSbCKobko|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Example: A Simple Quiz ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
answer = input(&amp;quot;Which planet is known as the Red Planet? &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if answer == &amp;quot;Mars&amp;quot;:&lt;br /&gt;
    print(&amp;quot;Correct!&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Try again.&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program contains one condition and two possible outputs. A stronger version could accept different capitalizations, keep a score, or give a hint after an incorrect answer.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Testing and Debugging Selection =&lt;br /&gt;
&lt;br /&gt;
A selection statement can be syntactically correct and still make the wrong decision. This is a &amp;#039;&amp;#039;&amp;#039;logic error&amp;#039;&amp;#039;&amp;#039;. Good testing checks more than one input.&lt;br /&gt;
&lt;br /&gt;
For a condition such as &amp;#039;&amp;#039;&amp;#039;age &amp;gt;= 13&amp;#039;&amp;#039;&amp;#039;, useful test values include 12, 13, and 14. The value 13 is especially important because it is the &amp;#039;&amp;#039;&amp;#039;boundary&amp;#039;&amp;#039;&amp;#039; where the decision changes.&lt;br /&gt;
&lt;br /&gt;
When debugging selection, ask yourself whether the comparison operator is correct, whether the branches are in the right order, whether every important case is covered, and whether a condition can ever be true.&lt;br /&gt;
&lt;br /&gt;
A trace table can help. Write down the input values, evaluate each condition, and record which branch runs. This turns guessing into a clear step-by-step check.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
A common mistake is using &amp;#039;&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;&amp;#039; when &amp;#039;&amp;#039;&amp;#039;&amp;gt;=&amp;#039;&amp;#039;&amp;#039; is needed. Another is testing conditions in an order that makes a later branch unreachable. A third is forgetting that text comparisons may depend on spelling and capitalization.&lt;br /&gt;
&lt;br /&gt;
Indentation also matters in languages such as Python because it shows which instructions belong to a branch. In block-based languages, the shape and nesting of blocks show this structure visually.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Responsible Use of Selection =&lt;br /&gt;
&lt;br /&gt;
Selection is powerful because it lets software make choices. That means programmers should think carefully about the rules they create. A rule can be technically correct but still be unfair, unsafe, or based on poor data.&lt;br /&gt;
&lt;br /&gt;
For school projects, use selection to solve clear problems and avoid unnecessary use of personal information. When a decision affects people, explain the condition in plain language and test whether it behaves as intended for different cases.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Extending Your Thinking =&lt;br /&gt;
&lt;br /&gt;
More advanced programs may use many related decisions. Some languages provide structures such as &amp;#039;&amp;#039;&amp;#039;switch&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;match&amp;#039;&amp;#039;&amp;#039; for choosing among several fixed cases. The exact syntax differs between languages, but the central idea remains the same: evaluate information and choose an appropriate branch.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=1wsaV5nVC7g|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Interactive Tasks =&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Quiz: Test Your Knowledge ==&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What is the main purpose of selection in a program?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(To choose between different paths)&lt;br /&gt;
(!To repeat instructions forever)&lt;br /&gt;
(!To store every value as text)&lt;br /&gt;
(!To turn code into an image)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What kind of result should a basic condition produce?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(True or false)&lt;br /&gt;
(!A picture or sound)&lt;br /&gt;
(!A file name)&lt;br /&gt;
(!A random color)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Which keyword usually starts a basic selection statement?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(if)&lt;br /&gt;
(!repeat)&lt;br /&gt;
(!print)&lt;br /&gt;
(!import)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What does an else branch do?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Runs when the if condition is false)&lt;br /&gt;
(!Runs before every condition)&lt;br /&gt;
(!Repeats the if branch)&lt;br /&gt;
(!Deletes the condition)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Which comparison checks whether two values are equal in Python?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Two equals signs)&lt;br /&gt;
(!One equals sign)&lt;br /&gt;
(!One greater than sign)&lt;br /&gt;
(!One less than sign)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When is an AND condition true?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(When all connected conditions are true)&lt;br /&gt;
(!When every condition is false)&lt;br /&gt;
(!When exactly one condition is written)&lt;br /&gt;
(!Whenever a variable contains text)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why is a boundary value useful in testing?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(It checks where a decision changes)&lt;br /&gt;
(!It makes the program run faster)&lt;br /&gt;
(!It replaces all other test data)&lt;br /&gt;
(!It creates a new variable automatically)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What does a diamond usually represent in a flowchart?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(A decision)&lt;br /&gt;
(!A printed message)&lt;br /&gt;
(!A stored file)&lt;br /&gt;
(!A program title)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What is nested selection?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(A selection statement inside another selection statement)&lt;br /&gt;
(!A loop that never stops)&lt;br /&gt;
(!A variable inside a string)&lt;br /&gt;
(!A comment inside a flowchart)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What is a logic error in selection?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(The program runs but makes the wrong decision)&lt;br /&gt;
(!The monitor is switched off)&lt;br /&gt;
(!The keyboard has no space key)&lt;br /&gt;
(!The file has a long name)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Memory Game ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;memo-quiz&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Condition || A test that is evaluated as true or false&lt;br /&gt;
|-&lt;br /&gt;
| Branch || One possible path through a selection structure&lt;br /&gt;
|-&lt;br /&gt;
| Boolean || A data type with the values true and false&lt;br /&gt;
|-&lt;br /&gt;
| Comparator || An operator that compares two values&lt;br /&gt;
|-&lt;br /&gt;
| Boundary || A value where the outcome of a decision can change&lt;br /&gt;
|-&lt;br /&gt;
| Nesting || Placing one selection structure inside another&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Drag and Drop ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;lueckentext-quiz&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Match the correct terms.&lt;br /&gt;
! Topic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;if&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Starts a condition check&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;else&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Gives an alternative branch&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AND&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Requires all connected conditions to be true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;OR&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Requires at least one connected condition to be true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Reverses a Boolean value&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Crossword Puzzle ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;kreuzwort-quiz&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Condition || What is a true-or-false test called?&lt;br /&gt;
|-&lt;br /&gt;
| Boolean || What data type has only true and false values?&lt;br /&gt;
|-&lt;br /&gt;
| Branch || What is one possible path through a decision called?&lt;br /&gt;
|-&lt;br /&gt;
| Comparator || What kind of operator compares two values?&lt;br /&gt;
|-&lt;br /&gt;
| Nested || What word describes selection placed inside selection?&lt;br /&gt;
|-&lt;br /&gt;
| Flowchart || What diagram uses shapes and arrows to show an algorithm?&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== LearningApps ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe&amp;gt; https://learningapps.org/index.php?s=Selection+in+Programming &amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Cloze Text ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;quiz display=simple&amp;gt;&lt;br /&gt;
{&amp;#039;&amp;#039;&amp;#039;Complete the text.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
|type=&amp;quot;{}&amp;quot;}&lt;br /&gt;
Selection lets a program { choose } between different paths. A true-or-false test is called a { condition }. An if statement runs its branch when the condition is { true }. An else branch provides an { alternative }. The logical operator { AND } requires all connected conditions to be true. A decision is often shown as a { diamond } in a flowchart. Testing the value where an outcome changes checks a { boundary }. A selection statement placed inside another one is called { nesting }.&lt;br /&gt;
&amp;lt;/quiz&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Open-Ended Tasks =&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Easy ===&lt;br /&gt;
# [[English:Everyday Decision Algorithm|Everyday Decision Algorithm]]: Write five everyday if-then decisions and turn one of them into a simple flowchart.&lt;br /&gt;
# [[English:Two-Choice Story|Two-Choice Story]]: Create a short interactive story with one decision and two different endings.&lt;br /&gt;
# [[English:Condition Cards|Condition Cards]]: Make illustrated cards showing five conditions and label each possible result as true or false for a chosen example.&lt;br /&gt;
# [[English:Selection Screenshot Explanation|Selection Screenshot Explanation]]: Build one if or if-else structure in a block-based programming tool, capture an image of it, and explain what each branch does.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Standard ===&lt;br /&gt;
# [[English:Quiz Program Project|Quiz Program Project]]: Create a three-question quiz that uses selection to check answers and update a score.&lt;br /&gt;
# [[English:Weather Adviser Program|Weather Adviser Program]]: Design a program that recommends an action from temperature and rain information using at least two conditions.&lt;br /&gt;
# [[English:Flowchart to Code|Flowchart to Code]]: Draw a flowchart with at least three outcomes and then implement the same logic in a programming language.&lt;br /&gt;
# [[English:Peer Debugging Interview|Peer Debugging Interview]]: Interview a classmate about a selection bug they found, reproduce the bug, and document how it was fixed.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
# [[English:Boundary Testing Investigation|Boundary Testing Investigation]]: Create a program with at least two numerical boundaries, design a test table around those boundaries, and explain the results.&lt;br /&gt;
# [[English:Nested Selection Game|Nested Selection Game]]: Build a small game that uses nested selection for a meaningful gameplay decision, then redesign one part to reduce unnecessary nesting.&lt;br /&gt;
# [[English:Fair Decision Rules|Fair Decision Rules]]: Investigate a real or imagined automated decision system, identify the conditions it might use, and propose changes that make the rules clearer and fairer.&lt;br /&gt;
# [[English:Selection Tutorial Video|Selection Tutorial Video]]: Produce a short teaching video that explains if, else, Boolean conditions, flowcharts, and one debugging strategy with your own examples.&lt;br /&gt;
&lt;br /&gt;
{{:Open Task - Create a MOOC}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Learning Assessment =&lt;br /&gt;
&lt;br /&gt;
# [[English:Trace a Selection Program|Trace a Selection Program]]: Given a short program with several inputs, predict each branch that runs and justify every prediction by evaluating the conditions.&lt;br /&gt;
# [[English:Design from Requirements|Design from Requirements]]: Convert a written set of rules for a school club or game into a flowchart and working selection structure, then explain how each rule maps to a branch.&lt;br /&gt;
# [[English:Debug a Boundary Error|Debug a Boundary Error]]: Repair a program that handles a boundary incorrectly, show the failing and passing test cases, and explain why the changed operator fixes the problem.&lt;br /&gt;
# [[English:Compare Two Solutions|Compare Two Solutions]]: Solve the same decision problem once with nested selection and once with combined Boolean operators, then evaluate which version is clearer.&lt;br /&gt;
# [[English:Evaluate Decision Coverage|Evaluate Decision Coverage]]: Inspect a multi-branch algorithm, identify any missing or unreachable cases, and propose a corrected order of conditions.&lt;br /&gt;
# [[English:Transfer to a New Context|Transfer to a New Context]]: Apply selection to a new situation such as a sensor, game, quiz, or recommendation tool and explain what data, conditions, and outputs are required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Evidence of Learning =&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;Knowledge&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
: You can explain selection, conditions, Boolean values, comparison operators, branches, logical operators, nested selection, flowchart decisions, and boundary testing.&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;Skills&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
: You can write and trace if, if-else, and multi-branch structures; combine conditions; draw flowcharts; test important cases; and debug logic errors.&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;Products&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
: Useful evidence can include a working program, an annotated flowchart, a test table, a debugging record, a storyboard, or a short tutorial video.&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;Transfer&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
: You can recognize a decision problem in a new context and choose suitable conditions, branches, and tests instead of copying a memorized example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= OERs on the Topic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe&amp;gt; https://en.m.wikipedia.org/wiki/Conditional_(computer_programming) &amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Linked Learning Areas =&lt;br /&gt;
&lt;br /&gt;
Selection connects programming with algorithms, logic, mathematics, game design, digital citizenship, and problem solving. Understanding it also prepares you for more complex topics such as loops, functions, input validation, and event-driven programs.&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
{{:D-Tab}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[English:Selection in Programming|Selection in Programming]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# [[English:Conditional statement|Conditional statement]]&lt;br /&gt;
# [[English:Boolean expression|Boolean expression]]&lt;br /&gt;
# [[English:Flowchart|Flowchart]]&lt;br /&gt;
# [[English:Algorithm|Algorithm]]&lt;br /&gt;
# [[English:Debugging|Debugging]]&lt;br /&gt;
# [[English:Scratch programming|Scratch programming]]&lt;br /&gt;
# [[English:Python programming|Python programming]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= aiMOOC Projects =&lt;br /&gt;
[[Category:English]]&lt;br /&gt;
[[Category:Selection in Programming]]&lt;br /&gt;
[[Category:Computer Science]]&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:Algorithms]]&lt;br /&gt;
[[Category:Grades 7-8]]&lt;br /&gt;
[[Category:AI_MOOC]]&lt;br /&gt;
[[Category:GPT aiMOOC]]&lt;br /&gt;
{{MT}}&lt;/div&gt;</summary>
		<author><name>Glanz</name></author>
	</entry>
</feed>