Unit 1 SDD - Implementation - Computational Constructs Flashcards

1
Q

What are keywords in programming?

A

Keywords are the actual commands that instruct the program to do something.

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

What are constructs in programming?

A

Constructs are groups of keywords that serve a specific purpose, such as IF…END IF for selection.

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

What is a variable in programming?

A

A variable is a storage location for data that can change during program execution.

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

What is assignment in programming?

A

Assignment is the process of storing a value in a variable using commands like SET.

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

What are operators in programming?

A

Operators are symbols or words that manipulate data, including arithmetic, comparison, and logical operators.

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

What is an expression in programming?

A

An expression is a combination of data, operators, and values that produces a final computed result.

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

What are arithmetic operators?

A

Arithmetic operators perform mathematical calculations: Addition (+), Subtraction (-), Multiplication (*), Division (/), Exponentiation (^).

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

What are comparison operators?

A

Comparison operators compare values and return TRUE or FALSE: = (equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), != (not equal to).

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

What is an IF statement?

A

An IF statement executes a block of code only if a specified condition is TRUE.

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

What is an ELSE IF statement?

A

ELSE IF allows multiple conditions to be checked in an IF statement before reaching the final ELSE.

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

What are logical operators?

A

Logical operators allow multiple conditions to be combined: AND (both must be TRUE), OR (at least one must be TRUE), NOT (reverses truth value).

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

How does the AND logical operator work?

A

AND returns TRUE only if both conditions are TRUE.

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

How does the OR logical operator work?

A

OR returns TRUE if at least one of the conditions is TRUE.

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

How does the NOT logical operator work?

A

NOT inverts the truth value of an expression (TRUE becomes FALSE and vice versa).

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

What is a complex condition in programming?

A

A complex condition combines multiple expressions using logical operators for decision-making.

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

What is concatenation in programming?

A

The process of joining two or more strings together.

17
Q

Which operator is used for concatenation in many programming languages?

A

‘&’ in some languages, ‘+’ in others like Python.

18
Q

What is a selection construct in programming?

A

A structure that allows a program to make decisions, usually with IF statements.

19
Q

What is the purpose of an IF statement?

A

To execute a block of code if a condition is TRUE.

20
Q

How does an IF statement with ELSE work?

A

Executes the ELSE block if the IF condition is FALSE.

21
Q

What are the two types of loops?

A

Fixed loops and conditional loops.

22
Q

What is a fixed loop?

A

A loop that repeats a defined number of times.

23
Q

What is a conditional loop?

A

A loop that repeats based on a Boolean condition.

24
Q

What is an example of a fixed loop?

A

FOR counter FROM 1 to 10 DO … END FOR.

25
Q

What is an example of a conditional loop?

A

WHILE score < 100 DO … END WHILE.

26
Q

What is the difference between WHILE and REPEAT UNTIL loops?

A

WHILE checks the condition before execution, REPEAT UNTIL checks after execution.

27
Q

What are predefined functions?

A

Built-in functions that perform common tasks.

28
Q

What does the random function do?

A

Generates a pseudo-random number.

29
Q

How do you generate a random integer between 1 and 10 in Python?

A

Use randint(1, 10) from the random module.

30
Q

What does the round function do?

A

Rounds a real number to a specified number of decimal places.

31
Q

What are the floor and ceiling functions?

A

Floor rounds down, ceiling rounds up.

32
Q

How do you get the length of a string in Python?

A

Use the len() function.

33
Q

What does the length function return?

A

The number of characters in a string.

34
Q

How can you find the length of a concatenated name?

A

Use LENGTH(firstname & surname).