Karteikarten
Code Basics
Karten in diesem Stapel (5)
- 1OperatorsOperators are symbols that represent different ways of modifying, comparing, and evaluating information.
Arithmetic operators are used to make calculations.
Comparison operators determine the relationship between two values, which results in a boolean.
Logical operators determine the logical state of multiple boolean values or expressions, which results in another boolean. - 2Control FlowEach of programs is a set of instructions, executed in a certain order. This order, called control flow, is just as important as the instructions themselves.
- 3Conditional (Control Flow)Programmers can give them multiple sets of instructions and describe the right conditions in which to use each set. They can describe a structure like this: “if X, then do instruction set 1. Otherwise do instruction set 2.” This structure is called a conditional control structure because the computer’s instructions depend on some condition(s).
- 4Loop (Control Flow)A loop is a sequence of instructions which is specified once but which may be carried out several times in a row. In this case there is one instruction (play a sound) and it should be carried out 4 times.
Loop structures can also specify that the instructions are repeated until a certain condition is met. For example, “Repeat a sound until you are booed off stage”. - 5Exeption (Control Flow)In exception handling, two sets of instructions are defined. The first set is executed, and if an exception occurs, the first set is stopped and the second set of instructions is executed.
In this example,
The first set is “collect shipping address”, “collect email address”
The second set is “reject the purchase”
If any errors occur in executing the first set—maybe the address is incorrectly formatted, or fake—it is stopped and the second set is executed.
Informationen
- Beschreibung
- Karteikarten am Code Basics, erstellt von Niklas Jaschinski am 09/01/2022.
- Erstellt von
- Niklas Jaschinski
- Aufrufe
- 1
- Bewertung