TMA02 Flashcards

(34 cards)

1
Q

What are mutually exclusive conditions?

A

Only one condition can be true or satisfied at any time

If one condition is true, all others must be false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the outcome of mutually exclusive conditions?

A

Only one of the conditions will report true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does checking code by inspection involve?

A

Assessing whether a script works, just by looking at it and thinking about it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is selection (branching) in programming?

A

When the actions to be taken depend on conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name two types of selection blocks.

A
  • if
  • if-else
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Boolean blocks in programming?

A

Condition blocks where action is taken if the condition holds (true/false).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do comparison blocks do?

A

Compare conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define sequencing in programming.

A

A program’s instructions are executed in the order they are written, unless modified by control structures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What happens after a selection block is executed?

A

Sequential execution resumes with the next instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is repetition in programming?

A

An instruction that directs a set of instructions to run repeatedly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Repetition can occur under which two conditions?

A
  • A fixed number of times
  • Indefinitely (or until some condition holds)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: Selection allows a program to choose whether to execute a specific set of instructions based on whether a given condition is _______.

A

[true or false]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does precedence refer to in programming?

A

The order in which operations within a calculation are carried out

Precedence is essential for determining how expressions are evaluated in programming languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is nesting in programming?

A

Placing one programming construct inside another of the same or different type

Nesting allows for more complex operations and control structures in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does BIDMAS stand for?

A

Bracket-Indices (powers)-Division-Multiplication-Addition-Subtraction

BIDMAS is a mnemonic to remember the order of operations in mathematics and programming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define constants in programming.

A

Represent unchanging data

Constants are values that do not change during the execution of a program.

17
Q

What is incremental construction?

A

The idea of constructing data in stages

This approach allows for gradual development and modification of data structures.

18
Q

What is a data structure?

A

List with a collection of data

Data structures organize and store data efficiently for processing.

19
Q

What does persistent data refer to?

A

A list of data that remains when a program is shut down and run again

Persistent data is crucial for applications that require data retention between sessions.

20
Q

Fill in the blank: _______ refers to the order in which operations within a calculation are carried out.

A

[key learning term: Precedence]

21
Q

True or False: Nesting can only occur with similar types of programming constructs.

A

False

Nesting can occur with constructs of different types, allowing for versatile programming.

22
Q

What are lists in programming?

A

Lists are important components of programming languages that allow a collection of data to be stored together.

Lists can hold various data types and are used for organizing data efficiently.

23
Q

What are parallel lists?

A

Parallel lists are lists such that each item in one list is related in some way to the item in the same position in the other list.

This structure is often used to manage related data, such as names and corresponding ages.

24
Q

What is the purpose of a sentinel value in programming?

A

A sentinel value is used to stop loops and is particularly useful in handling an unknown number of user inputs.

Sentinels help prevent infinite loops by providing a clear exit condition.

25
What does iteration refer to in programming?
Iteration refers to a single run of the loop's contents. ## Footnote Each iteration processes data within a loop.
26
What is an index variable?
An index variable enables different iterations of a loop's contents to process various items of data within a collection. ## Footnote It typically increments with each iteration.
27
What are boundary values in programming?
Boundary values are where the program requirements change. ## Footnote They are critical for testing and ensuring code handles edge cases.
28
What are flag variables?
Flag variables signal whether an event has occurred and are represented by True/false (1/0). ## Footnote They help track the state of a process or condition.
29
What does ASCII stand for?
American Standard Code for Information Interchange. ## Footnote ASCII assigns a number to each character, distinguishing between upper-case and lower-case letters.
30
What is an example of an ASCII value?
'a' is assigned the number 97, and 'b' is assigned the number 98. ## Footnote This coding system is widely used in computer programming and data representation.
31
What are mutually exclusive conditions?
Mutually exclusive conditions mean only one condition can hold at any time (if<>then|). ## Footnote In such cases, only one of the conditions will report true.
32
What does checking code by inspection involve?
Checking code by inspection involves assessing whether a script works just by looking at it and thinking about it. ## Footnote This method helps identify logical errors without running the code.
33
What is modular programming?
Modular programming uses custom blocks to separate components that combine to form a complete program.
34
What is meant by factored out/ refactoring?
Code replaced by a custom block/ amending a program's structure using custom blocks