Unit 4 Pseudocode Flashcards

1
Q

What is pseudocode?

A

Pseudocode is a simplified, informal way of describing a program’s logic and algorithms using plain language, without the strict syntax of actual programming code.

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

What is the main purpose of pseudocode?

A

To help programmers plan, and visualise the structure and logic of their algorithm before writing the actual code.

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

What are the basic elements of pseudocode?

A

Keywords like BEGIN, END, IF-THEN-ELSE, WHILE, FOR, PRINT, logical conditions, and simple variable assignments.

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

WHILE in pseudocode

A

BEGIN
SET i = 1
WHILE i <= 5
PRINT i
i = i + 1
ENDWHILE
END

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

IF in pseudocode

A

BEGIN
INPUT number
IF number % 2 == 0 THEN
PRINT “The number is even”
ENDIF
END

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

FOR in pseudocode

A

BEGIN
FOR i = 2 TO 10 STEP 2
PRINT i
ENDFOR
END

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

THEN in pseudocode

A

BEGIN
INPUT value
IF value > 100 THEN
PRINT “Value is greater than 100”
ENDIF
END

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

ELSE in Pseudocode

A

BEGIN
INPUT age
IF age >= 18 THEN
PRINT “Adult”
ELSE
PRINT “Minor”
ENDIF
END

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