First 50 of 190 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Programming, object modelling and software development
In object-oriented modelling, how do a Klasse and an Instanz (Objekt) relate to each other?
- The class is the blueprint describing attributes and methods; an instance is a concrete object created from it with its own attribute values Correct answer.
- The class is a single running object; instances are copies of its source code stored on disk
- An instance is a class that has no methods, only attributes
- Class and instance are synonyms; the two terms are interchangeable in UML
Explanation
A class defines the structure (attributes) and behaviour (methods) common to a family of objects. Instantiation creates an object that owns its own copy of the attribute values while sharing the method definitions of the class.
Question 2Programming, object modelling and software development
A class Sensor stores a measured value and can output it in a formatted way. Which assignment of the two concepts is correct?
- messwert is an attribute (state), ausgeben() is a method (behaviour) Correct answer.
- messwert is a method, ausgeben() is an attribute
- Both are attributes, because both belong to the class
- Both are methods, because everything inside a class is executable
Explanation
Attributes store the state of an object; methods define the operations an object can perform. A stored measured value is state, so it is an attribute; a formatted output operation is behaviour, so it is a method.
Question 3Programming, object modelling and software development
Why does the Fachlehrplan require access specifiers (Zugriffsspezifikationen) such as private to be chosen 'kontextbezogen'?
- Declaring attributes private forces access through defined methods, so the class can validate values and keep its internal representation changeable Correct answer.
- private attributes need less memory than public attributes
- private is required by the compiler for every attribute of every class
- private makes the attribute value invisible to a debugger, which increases data protection under the DSGVO
Explanation
Encapsulation means external code sees only the public interface. Routing access through getter/setter methods lets the class check values (e.g. reject a negative measurement) and lets the internal representation change later without breaking client code.
Question 4Programming, object modelling and software development
A UML class diagram shows the class Konto with the entries
- kontostand : double
+ einzahlen(betrag : double) : void
How are the leading symbols read?
- − marks private visibility, + marks public visibility Correct answer.
- − marks a negative default value, + marks a positive default value
- − marks an attribute, + marks a class-level (static) member
- − marks an abstract member, + marks an implemented member
Explanation
UML visibility markers are: − private, + public, # protected, ~ package. The diagram therefore states that kontostand is only accessible inside Konto while einzahlen() is part of the public interface.
Question 5Programming, object modelling and software development
How do Überladen (overloading) and Überschreiben (overriding) differ, both of which the Fachlehrplan lists under Polymorphie?
- Overloading defines several methods with the same name but different parameter lists in the same class; overriding replaces an inherited method in a subclass using the identical signature Correct answer.
- Overloading replaces an inherited method; overriding defines several methods with the same name in one class
- Overloading changes only the return type; overriding changes only the visibility
- Both mean the same and differ only in the programming language used
Explanation
Overloading is resolved at compile time from the argument types, so the parameter lists must differ. Overriding needs the identical signature in a subclass and is resolved at runtime from the actual object type (dynamic binding).
Question 6Programming, object modelling and software development
A class Rechner declares:
int addiere(int a, int b)
double addiere(double a, double b)
int addiere(int a, int b, int c)
Which mechanism is shown and why is the code legal?
- Überladen - the three methods share a name but have distinct parameter lists, so the compiler can select the right one from the arguments Correct answer.
- Überschreiben - a subclass replaces an inherited implementation three times
- It is illegal, because a class may not declare two methods with the same name
- It is legal only because the return types differ between the first two methods
Explanation
The parameter lists (int,int), (double,double) and (int,int,int) are pairwise different, so each call site is unambiguously resolvable at compile time. This is method overloading within one class.
Question 7Programming, object modelling and software development
Given
class Fahrzeug { public String beschreibung() { return "Fahrzeug"; } }
class Lkw extends Fahrzeug { public String beschreibung() { return "Lkw"; } }
Fahrzeug f = new Lkw();
System.out.println(f.beschreibung());
What is printed and why?
- "Lkw", because the overridden method is selected at runtime from the actual object type (dynamic binding) Correct answer.
- "Fahrzeug", because the declared type of the variable f decides which method runs
- A compiler error, because a Lkw object may not be stored in a Fahrzeug variable
- "FahrzeugLkw", because both implementations run one after the other
Explanation
The declared type Fahrzeug determines which methods may be called; the actual object type Lkw determines which implementation executes. Because beschreibung() is overridden, dynamic binding dispatches to the Lkw version and "Lkw" is printed.
Question 8Programming, object modelling and software development
Class Elektrofahrzeug inherits from class Fahrzeug. Which statement about this Vererbung is correct?
- Elektrofahrzeug takes over the attributes and methods of Fahrzeug and can add its own or redefine inherited ones ('is-a' relationship) Correct answer.
- Fahrzeug takes over the attributes of Elektrofahrzeug, since the subclass is more specific
- Inheritance copies the source code of Fahrzeug into Elektrofahrzeug, so later changes to Fahrzeug have no effect
- Inheritance means an Elektrofahrzeug object contains a separate Fahrzeug object as an attribute
Explanation
Inheritance builds a generalisation/specialisation hierarchy: the subclass automatically possesses the superclass members, may extend them and may override them. Semantically every Elektrofahrzeug 'is a' Fahrzeug.
Question 9Programming, object modelling and software development
In UML, how do Aggregation and Komposition differ?
- Aggregation (hollow diamond) is a weak part-of relation whose parts can exist independently; composition (filled diamond) is a strong ownership in which the parts are destroyed with the whole Correct answer.
- Aggregation (filled diamond) means the parts are destroyed with the whole; composition (hollow diamond) allows independent parts
- Aggregation applies only to attributes, composition only to methods
- Aggregation is a form of inheritance, composition is a form of interface implementation
Explanation
Both are part-of relations. Aggregation uses a hollow diamond at the whole and permits the part to be shared or to outlive the whole. Composition uses a filled diamond, gives the whole exclusive ownership and ties the part's lifetime to it.
Question 10Programming, object modelling and software development
A UML association between Bestellung and Position carries the multiplicity 1..* at the Position end. What does that mean?
- Every Bestellung is linked to at least one and possibly many Position objects Correct answer.
- Every Bestellung is linked to exactly one Position object
- Every Bestellung may be linked to zero or more Position objects
- There may be at most one Bestellung in the entire system
Explanation
The multiplicity 1..* states a lower bound of 1 and an unbounded upper limit: an order must contain at least one line item and may contain arbitrarily many.
Question 11Programming, object modelling and software development
Which information does a UML Sequenzdiagramm convey that a Klassendiagramm cannot?
- The chronological order of messages exchanged between concrete objects, shown along vertical lifelines with activation bars Correct answer.
- The static list of attributes and their data types for every class
- The physical deployment of components onto servers and network nodes
- The normalisation level of the underlying database tables
Explanation
A sequence diagram is a behavioural (dynamic) view: objects appear as lifelines running down the page, and arrows between them show messages in the order they occur, with activation bars marking when an object is executing.
Question 12Programming, object modelling and software development
A UML diagram shows a box labelled 'm1 : Messstelle' containing 'ort = "Halle"' and 'wert = 21.4'. Which diagram type is this, and what does it document?
- An Objektdiagramm - a snapshot of concrete instances with their actual attribute values at one moment Correct answer.
- A Klassendiagramm - the general structure of the class Messstelle including data types
- A Sequenzdiagramm - the order in which the object receives messages
- An Aktivitätsdiagramm - the control flow inside the method of a class
Explanation
The notation 'instanceName : ClassName' with concrete attribute values is the UML object-diagram notation. It captures one valid system state and is typically used to illustrate or test a class diagram against a real case.
Question 13Programming, object modelling and software development
What is the purpose of a Konstruktor in an object-oriented program?
- It runs automatically when an object is created and brings the new instance into a valid initial state Correct answer.
- It releases the memory of an object when it is no longer needed
- It defines the data type of the class and must return that type explicitly
- It has to be called manually after object creation before any attribute may be read
Explanation
A constructor carries the class name, has no return type and is invoked implicitly by the object-creation expression. It typically assigns start values to the attributes so that no instance can exist in an undefined state.
Question 14Programming, object modelling and software development
Given
class Zaehler {
private int stand = 0;
public void erhoehen() { stand = stand + 2; }
public int getStand() { return stand; }
}
Zaehler z = new Zaehler();
z.erhoehen(); z.erhoehen(); z.erhoehen();
System.out.println(z.getStand());
What is printed?
- 6 Correct answer.
- 3
- 2
- 0
Explanation
The attribute stand starts at 0 and each call of erhoehen() adds 2. Three calls therefore give 0 + 2 + 2 + 2 = 6, which getStand() returns.
Question 15Programming, object modelling and software development
Consider
Konto a = new Konto(100);
Konto b = a;
b.einzahlen(50);
System.out.println(a.getStand());
What is printed and why?
- 150, because a and b are two references to the SAME object, so the deposit is visible through both Correct answer.
- 100, because the assignment b = a created an independent copy of the object
- 50, because b was initialised with the deposited amount only
- A runtime error, because two variables may not reference one object
Explanation
Assigning an object variable copies the reference, not the object. After b = a both names point to one and the same Konto instance, so b.einzahlen(50) changes the state that a also sees: 100 + 50 = 150.
Question 16Programming, object modelling and software development
A class Messreihe must count how many Messreihe objects have been created in total. Which member kind is appropriate?
- A class-level (static) attribute, because the value belongs to the class as a whole rather than to any single instance Correct answer.
- A normal instance attribute, because every object must store the total itself
- A local variable inside the constructor, because it is set when an object is created
- A constant, because the number of objects is fixed at compile time
Explanation
A static attribute exists exactly once, independently of how many objects exist, and is the standard way to hold data shared by all instances such as an object counter incremented in the constructor.
Question 17Programming, object modelling and software development
In Java, String.substring(beginIndex, endIndex) returns the characters from beginIndex up to but NOT including endIndex, counting from 0. What does "Informationstechnik".substring(6, 11) return?
- "ation" Correct answer.
- "ations"
- "mation"
- "tion"
Explanation
Indices: I0 n1 f2 o3 r4 m5 a6 t7 i8 o9 n10 s11. Characters 6 to 10 inclusive are a, t, i, o, n, giving "ation" - five characters, matching 11 − 6 = 5.
Question 18Programming, object modelling and software development
A method computes the length of the hypotenuse with Math.sqrt(Math.pow(3, 2) + Math.pow(4, 2)). What value is returned?
- 5.0 Correct answer.
- 7.0
- 25.0
- 12.0
Explanation
Math.pow(3,2) = 9.0 and Math.pow(4,2) = 16.0. Their sum is 25.0, and Math.sqrt(25.0) = 5.0 - the Pythagorean result for legs 3 and 4.
Question 19Programming, object modelling and software development
An array messungen holds five Messstelle objects whose getWert() values are, in index order, [30, 15, 22, 20, 31]. Trace:
int anzahl = 0;
for (int i = 1; i < messungen.length; i++) {
if (messungen[i].getWert() > 20) anzahl++;
}
What is the final value of anzahl?
- 2 Correct answer.
- 3
- 4
- 5
Explanation
The loop starts at i = 1, so index 0 (value 30) is never examined. It inspects 15 (no), 22 (yes), 20 (no, because 20 > 20 is false) and 31 (yes). anzahl = 2.
Question 20Programming, object modelling and software development
In a simple GUI the user must type a single-line measurement value that the program then reads. Which control element is intended for this?
- A text field (Textfeld / Eingabefeld) Correct answer.
- A label (Bezeichnerfeld)
- A button (Schalter)
- A window frame (Fenster)
Explanation
A text field is the standard single-line input object: it accepts keyboard entry and exposes the entered text to the program for conversion and processing.
Question 21Programming, object modelling and software development
An Auftrag consists of Auftragspositionen. A position has no meaning without its order and is deleted together with it. Which UML relationship models this correctly?
- Komposition, drawn with a filled diamond at the Auftrag end, because the parts depend existentially on the whole Correct answer.
- Aggregation, drawn with a hollow diamond at the Auftrag end, because the parts can be reassigned to other orders
- Vererbung, with Auftragsposition as a subclass of Auftrag
- A plain association without a diamond, because only the multiplicities matter
Explanation
Existential dependency - the part cannot exist without the whole and is destroyed with it - is exactly the semantics of composition, drawn with a filled diamond at the whole (Auftrag).
Question 22Algorithms, recursion and complexity
What structural property distinguishes a Struktogramm (Nassi-Shneiderman diagram) from a Programmablaufplan (flowchart)?
- A Struktogramm is built from nested rectangular blocks with no connecting arrows, so unstructured jumps cannot be drawn Correct answer.
- A Struktogramm may only represent sequences, while loops must always be drawn as a Programmablaufplan
- A Struktogramm shows the runtime memory layout of variables, while a Programmablaufplan shows control flow
- A Struktogramm is written in a specific programming language, while a Programmablaufplan is language-independent
Explanation
A Struktogramm partitions one outer rectangle into nested sub-rectangles. Because control flow is expressed purely by nesting rather than by arrows, an arbitrary GOTO-style jump has no notation - the diagram enforces structured programming. A Programmablaufplan uses shapes joined by directed arrows, which can express unstructured jumps.
Question 23Algorithms, recursion and complexity
Trace the algorithm and give the printed value:
s ← 0
FOR i ← 1 TO 5 DO
IF i MOD 2 = 1 THEN
s ← s + i
END IF
END FOR
OUTPUT s
- 9 Correct answer.
- 15
- 6
- 25
Explanation
i MOD 2 = 1 is true exactly for the odd values 1, 3 and 5. The accumulator therefore receives 1 + 3 + 5 = 9. The even values 2 and 4 fail the condition and are skipped.
Question 24Algorithms, recursion and complexity
Bubble sort ascending compares each adjacent pair from left to right and swaps if the left element is larger. What is the array after exactly ONE complete pass over [5, 1, 4, 2, 8]?
- [1, 4, 2, 5, 8] Correct answer.
- [1, 2, 4, 5, 8]
- [1, 5, 4, 2, 8]
- [5, 1, 4, 2, 8]
Explanation
Pass 1: (5,1) swap → [1,5,4,2,8]; (5,4) swap → [1,4,5,2,8]; (5,2) swap → [1,4,2,5,8]; (5,8) no swap. Result [1, 4, 2, 5, 8]. One pass guarantees only that the largest element has bubbled to the last position.
Question 25Algorithms, recursion and complexity
How many key comparisons does linear (sequential) search need in the worst case on an unsorted array with n elements?
- n Correct answer.
- n / 2
- log₂(n)
- n²
Explanation
In the worst case the sought key is in the last position or absent entirely, so every one of the n elements must be compared: n comparisons.
Question 26Algorithms, recursion and complexity
A sorted array holds 100 elements. What is the maximum number of key comparisons binary search needs to decide whether a given key is present?
- 7 Correct answer.
- 10
- 50
- 100
Explanation
Each comparison halves the remaining search interval: 100 → 50 → 25 → 12 → 6 → 3 → 1 → 0. That is 7 halvings, matching ⌊log₂(100)⌋ + 1 = 6 + 1 = 7 comparisons in the worst case.
Question 27Algorithms, recursion and complexity
In a C-style language a two-dimensional array is declared as int m[4][6]. How many int elements does it hold?
- 24 Correct answer.
- 10
- 35
- 20
Explanation
In C/Java-style declarations the numbers are element counts, so the array has 4 rows of 6 columns: 4 × 6 = 24 elements, with valid indices m[0][0] to m[3][5].
Question 28Algorithms, recursion and complexity
Trace the nested loop and state the final value of count:
count ← 0
FOR i ← 1 TO 4 DO
FOR j ← i TO 4 DO
count ← count + 1
END FOR
END FOR
- 10 Correct answer.
- 16
- 6
- 12
Explanation
The inner loop starts at j = i, so it runs 4 times for i = 1, 3 times for i = 2, 2 times for i = 3 and 1 time for i = 4. Total = 4 + 3 + 2 + 1 = 10.
Question 29Algorithms, recursion and complexity
A program must repeatedly insert new elements at the FRONT of a collection of n elements. Which comparison of an array with a singly linked list is technically correct?
- The linked list needs only a constant number of pointer assignments, while the array must shift all n existing elements one position to the right Correct answer.
- Both structures need to shift all n elements, so insertion cost is identical
- The array is faster because contiguous memory allows insertion without moving elements
- The linked list is slower because every insertion requires re-sorting the whole list
Explanation
A singly linked list inserts at the front by creating a node, pointing its next reference at the old head and updating the head reference - a constant amount of work independent of n. An array stores elements contiguously, so making room at index 0 forces every existing element to move up one slot: n move operations.
Question 30Algorithms, recursion and complexity
Which statement describes the Wasserfallmodell (waterfall model) of software development named in the Fachlehrplan?
- Phases such as analysis, design, implementation and test run strictly one after another, each being completed and documented before the next begins Correct answer.
- A rough version of the product is built immediately and then repeatedly refined together with the customer
- Development and operation merge into a continuous loop with automated deployment several times a day
- Each phase is executed by an independent team in parallel and the results are merged at the end
Explanation
The waterfall model is the classical sequential model: each phase produces a completed, documented result that is the input to the next phase, and the flow is meant to run only downwards. Its strength is planning and documentation discipline; its weakness is that late requirement changes are expensive.
Question 31Algorithms, recursion and complexity
A customer cannot describe the required user interface precisely at the start of a project. Which development approach from the Fachlehrplan fits best, and why?
- Evolutionäres Prototyping, because an executable preliminary version is presented to the customer early and refined step by step from the feedback Correct answer.
- Wasserfallmodell, because a complete requirements specification must be frozen before any code is written
- Wasserfallmodell, because the customer is not involved after the initial contract is signed
- Evolutionäres Prototyping, because it removes the need for any documentation or testing
Explanation
Evolutionary prototyping is chosen exactly when requirements are unclear or volatile: a working prototype makes abstract requirements tangible, the customer reacts to something concrete, and each iteration improves the product until it becomes the final system.
Question 32Algorithms, recursion and complexity
A Netzplan contains: A (3 days, start), B (4 days, after A), C (2 days, after A), D (5 days, after B), E (6 days, after C), F (1 day, after both D and E). What is the project duration and the critical path?
- 13 days along A → B → D → F Correct answer.
- 12 days along A → C → E → F
- 21 days along A → B → C → D → E → F
- 13 days along A → C → E → F
Explanation
There are two routes to F. A→B→D→F = 3 + 4 + 5 + 1 = 13 days; A→C→E→F = 3 + 2 + 6 + 1 = 12 days. F cannot start before BOTH predecessors are finished, so the project takes the longer route: 13 days, and A→B→D→F is the critical path.
Question 33Algorithms, recursion and complexity
Which statement correctly contrasts a Gantt-Diagramm with a Netzplan for project scheduling?
- The Gantt chart shows each activity as a bar on a calendar axis, making durations and overlaps visible, while the Netzplan makes logical dependencies, earliest/latest dates and float calculable Correct answer.
- The Gantt chart calculates the critical path automatically, while the Netzplan only shows a bar per activity
- The Gantt chart lists the project budget per activity, while the Netzplan lists the responsible staff
- Both diagrams show identical information and differ only in colour conventions
Explanation
A Gantt chart maps activities against a time axis, so start dates, durations and parallel work are immediately readable. A Netzplan is a dependency graph in which forward and backward passes yield earliest/latest start and finish dates, float and the critical path.
Question 34Algorithms, recursion and complexity
Using the same Netzplan - A (3, start), B (4, after A), C (2, after A), D (5, after B), E (6, after C), F (1, after D and E) - what is the total float (Gesamtpuffer) of activity E?
- 1 day Correct answer.
- 0 days
- 6 days
- 13 days
Explanation
Forward pass: E can start earliest at 3 + 2 = 5 and finishes earliest at 11. F must start at 12 because the critical branch A→B→D finishes at 12. Backward pass: E must finish at latest 12, so its latest start is 6. Total float = latest start − earliest start = 6 − 5 = 1 day.
Question 35Algorithms, recursion and complexity
Selection sort ascending repeatedly finds the minimum of the unsorted remainder and swaps it into the next position. What does [7, 3, 9, 1] look like after exactly TWO passes?
- [1, 3, 9, 7] Correct answer.
- [1, 3, 7, 9]
- [3, 7, 1, 9]
- [1, 7, 9, 3]
Explanation
Pass 1: minimum of the whole array is 1 at index 3; swap with index 0 → [1, 3, 9, 7]. Pass 2: minimum of indices 1..3 is 3, already at index 1, so the swap is with itself and nothing changes → [1, 3, 9, 7].
Question 36Algorithms, recursion and complexity
The following algorithm searches for the position of the maximum in a = [4, 11, 7, 11, 2]:
pos ← 0
FOR i ← 1 TO 4 DO
IF a[i] > a[pos] THEN pos ← i END IF
END FOR
OUTPUT pos
What is printed?
- 1 Correct answer.
- 3
- 11
- 4
Explanation
The comparison uses strict greater-than. At i = 1, 11 > 4 so pos becomes 1. At i = 3 the test is 11 > 11, which is false, so pos is not updated. The algorithm therefore returns the index of the FIRST maximum: 1.
Question 37Algorithms, recursion and complexity
A sorted database index contains about 1,000,000 records. Roughly how many comparisons does a worst-case binary search need, and what does this show about efficiency?
- About 20, because ⌊log₂(1 000 000)⌋ + 1 = 20 - the cost grows only logarithmically with the data volume Correct answer.
- About 1,000, because the cost grows with the square root of the number of records
- About 500,000, because on average half of the records must be inspected
- About 1,000,000, because every record must be checked at least once
Explanation
log₂(1 000 000) ≈ 19.93, so ⌊19.93⌋ + 1 = 20 comparisons suffice in the worst case. Doubling the data adds just one comparison, which is why logarithmic search scales to large data sets.
Question 38Algorithms, recursion and complexity
A program compiles without errors, starts, runs to completion - but computes an incorrect average. How is this fault classified?
- A logical error, because the syntax is valid but the implemented rule does not match the intended one Correct answer.
- A syntax error, because the compiler must have overlooked a missing symbol
- A hardware error, because correct source code always yields correct results
- A runtime error, because incorrect output always aborts the program
Explanation
Syntax errors are detected by the compiler and prevent translation. Here translation succeeded and execution completed, so the fault lies in the algorithm itself - for example dividing by the wrong count. That is a logical (semantic) error, findable only through testing with known expected values.
Question 39Algorithms, recursion and complexity
A method accepts integer inputs from 1 to 100 inclusive and must reject anything else. Which set of test values follows the boundary-value principle (Grenzwertanalyse) best?
- 0, 1, 100, 101 Correct answer.
- 1, 2, 3, 4
- 25, 50, 75, 99
- −1000, 0, 1000, 5000
Explanation
Off-by-one mistakes cluster at the edges of a valid range. Testing the last invalid value below (0), the first valid value (1), the last valid value (100) and the first invalid value above (101) directly exercises every comparison operator at the boundary.
Question 40Algorithms, recursion and complexity
Trace the Euclidean algorithm:
WHILE b ≠ 0 DO
r ← a MOD b
a ← b
b ← r
END WHILE
OUTPUT a
Starting with a = 48, b = 18, what is printed and how many loop iterations run?
- 6, after 3 iterations Correct answer.
- 6, after 2 iterations
- 12, after 3 iterations
- 18, after 1 iteration
Explanation
Iteration 1: 48 MOD 18 = 12, so a = 18, b = 12. Iteration 2: 18 MOD 12 = 6, so a = 12, b = 6. Iteration 3: 12 MOD 6 = 0, so a = 6, b = 0 and the condition fails. Output = 6, the greatest common divisor, after 3 iterations.
Question 41Algorithms, recursion and complexity
The Fachlehrplan requires programming problems to be solved by 'funktionale Zerlegung und Verfeinerung' (functional decomposition and refinement). What is the main technical benefit?
- Each sub-problem becomes a separately testable and reusable function, which improves readability, maintainability and error localisation Correct answer.
- The compiled program always becomes shorter and executes faster than a single long procedure
- Variables automatically become global, so no parameters have to be passed
- Decomposition removes the need to define an algorithm before coding
Explanation
Splitting a problem into named sub-functions with defined inputs and outputs allows each part to be tested in isolation, reused in other contexts and changed without touching the rest. The Fachlehrplan explicitly evaluates programs by readability (Lesbarkeit) and maintainability (Wartbarkeit).
Question 42Digital representation and data structures
The Sachsen-Anhalt Fachlehrplan Informationstechnik lists the basic building blocks of program flow (Grundstrukturen von Programmabläufen). Which set names the three classical control structures of structured programming?
- Sequence (Sequenz), selection (Selektion), and iteration (Iteration) Correct answer.
- Sequence (Sequenz), recursion (Rekursion), and inheritance (Vererbung)
- Selection (Selektion), encapsulation (Kapselung), and polymorphism (Polymorphie)
- Iteration (Iteration), aggregation (Aggregation), and instantiation (Instanziierung)
Explanation
Structured programming is built from exactly three control structures: sequence (statements executed one after another), selection (a condition chooses between alternative branches), and iteration (a block is repeated). The Fachlehrplan adds the Funktionsblock as a fourth structuring element for modularisation, but the three flow-control primitives are sequence, selection and iteration.
Question 43Digital representation and data structures
Which decimal value does the binary number 1011₂ represent?
- 11 Correct answer.
- 13
- 7
- 1011
Explanation
Each position carries a power of two: 1·2³ + 0·2² + 1·2¹ + 1·2⁰ = 8 + 0 + 2 + 1 = 11.
Question 44Digital representation and data structures
How does a QR code differ technically from a classic one-dimensional barcode?
- The QR code encodes information in two dimensions and includes error correction, so it stores far more data and stays readable when partly damaged Correct answer.
- The QR code encodes information in one dimension, the barcode in two
- Both store the same amount of data; the QR code is merely square
- The QR code stores no data itself but only a reference number to an online database
Explanation
A barcode varies only bar widths along one axis. A QR code is a matrix code using both axes, adds position-detection patterns for orientation and carries Reed-Solomon error correction, which allows reconstruction of the content even when a portion of the symbol is obscured.
Question 45Digital representation and data structures
Convert the decimal number 200 into the binary system.
- 11001000₂ Correct answer.
- 10010001₂
- 11000100₂
- 10101000₂
Explanation
200 = 128 + 64 + 8. Setting the bits for 128, 64 and 8 with the remaining positions at 0 gives 1100 1000₂. Check: 128 + 64 + 0 + 0 + 8 + 0 + 0 + 0 = 200.
Question 46Digital representation and data structures
Hexadecimal notation appears in MAC addresses, IPv6 addresses and colour values. What is the decimal value of 2F₁₆?
- 47 Correct answer.
- 215
- 31
- 26
Explanation
Hexadecimal digits carry powers of 16: 2·16¹ + F·16⁰. With F = 15 this is 32 + 15 = 47.
Question 47Digital representation and data structures
Which statement about the character encodings ASCII and Unicode/UTF-8 is correct?
- ASCII defines 128 characters in 7 bits, while Unicode covers the characters of virtually all writing systems and encodes them in UTF-8 with a variable length of 1 to 4 bytes Correct answer.
- ASCII and Unicode are identical; Unicode is merely the newer name
- UTF-8 always uses exactly 2 bytes per character and is therefore incompatible with ASCII
- Unicode stores only graphical symbols, while letters are always encoded in ASCII
Explanation
ASCII is a 7-bit code with 128 code points and covers only the basic Latin character set. Unicode assigns a code point to characters of nearly every writing system; UTF-8 encodes them in 1 to 4 bytes, with the first 128 code points byte-identical to ASCII, which makes UTF-8 backward compatible.
Question 48Digital representation and data structures
An uncompressed image measures 1920 × 1080 pixels with a colour depth of 24 bit. How large is the raw image data?
- About 6.22 million bytes, i.e. roughly 5.9 MiB Correct answer.
- About 2.07 million bytes, i.e. roughly 2.0 MiB
- About 49.8 million bytes, i.e. roughly 47.5 MiB
- About 0.78 million bytes, i.e. roughly 0.74 MiB
Explanation
1920 × 1080 = 2,073,600 pixels. A colour depth of 24 bit equals 3 bytes per pixel, so 2,073,600 × 3 = 6,220,800 bytes; divided by 1024² this is about 5.93 MiB.
Question 49Digital representation and data structures
Given a = 5 and b = 12, which of the following logical expressions evaluates to TRUE?
- NOT (a > 3) OR (b MOD 5 = 2) Correct answer.
- (a > 3) AND (b MOD 5 = 0)
- NOT ((a < 10) OR (b > 10))
- (a = 5) AND (b < 12)
Explanation
NOT (5 > 3) = NOT TRUE = FALSE, but 12 MOD 5 = 2, so the second operand is TRUE. FALSE OR TRUE = TRUE. An OR needs only one true operand.
Question 50Entity modelling, relational algebra and SQL
The Fachlehrplan requires the terms Datenbank, Datenbankmanagementsystem and Datenbanksystem to be distinguished. Which set of definitions is correct?
- The Datenbank is the structured stock of data; the DBMS is the software that manages and provides access to it; the Datenbanksystem is the two together Correct answer.
- The Datenbank is the software; the DBMS is the data stock; the Datenbanksystem is the server hardware
- All three terms describe the same thing and may be used interchangeably
- The Datenbank is a single table; the DBMS is a query; the Datenbanksystem is a form
Explanation
Standard definition: Datenbanksystem = Datenbank (the stored, structured data) + Datenbankmanagementsystem (the software providing storage, querying, transactions, access control and integrity assurance).