pseudocode_flashcards

(25 cards)

1
Q

Front

A

Back

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

What is pseudocode used for?

A

To plan program algorithms in structured English before converting them into a programming language.

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

Name two main methods for planning program algorithms.

A

Pseudocode (structured English) and flowcharts.

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

What does BEGIN … END represent in pseudocode?

A

It marks where an algorithm starts and finishes or separates sections of code.

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

Which pseudocode keywords are used for input and output?

A

INPUT and OUTPUT.

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

What is PRINT used for in pseudocode?

A

To produce a hard copy output.

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

What is the difference between READ and WRITE in pseudocode?

A

READ reads data from a file; WRITE writes data to a file.

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

Which keywords represent decisions in pseudocode?

A

IF … THEN … ELSE … ELSEIF (ELIF) and WHEN (select-case).

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

How are simple branches typically formatted in pseudocode?

A

Use IF … THEN with indented actions or wrapped in BEGIN … END.

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

What is ELSE used for in pseudocode?

A

To specify actions when an IF … THEN condition is not met.

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

What is ELSEIF (ELIF) used for?

A

For additional tests when the previous IF condition is not met.

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

What is WHEN used for in pseudocode?

A

To represent a select-case structure with multiple branches based on a variable’s value.

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

Name three pseudocode structures for repetition.

A

FOR … NEXT; REPEAT UNTIL; WHILE / WHILE NOT.

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

Describe the FOR loop in pseudocode.

A

An unconditional loop that iterates a set number of times specified on the pseudocode line.

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

Describe REPEAT UNTIL in pseudocode.

A

A conditional loop that continues until the specified condition becomes true.

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

Describe WHILE / WHILE NOT in pseudocode.

A

Conditional loops that iterate while a condition is true (or not true).

17
Q

List two DOs when writing pseudocode.

A

Use command words to identify branches/loops; use indents to show structure.

18
Q

List two DON’Ts when writing pseudocode.

A

Do not write actual runnable code; do not include excessive detail about how actions occur.

19
Q

In Zilch pseudocode, what does the Totals() array store?

A

The count of how many times each dice number (1–6) was thrown.

20
Q

Why set Winner to True before checking Totals()?

A

Assume all numbers were thrown; set to False if any number count is zero.

21
Q

How does the Zilch pseudocode handle the highest score (1,2,3,4,5,6)?

A

By checking Totals() to confirm each number 1–6 appears once, then adding 3000 to Score.

22
Q

How are points for dice showing 1 and 5 calculated?

A

Add 100 for each 1 and 50 for each 5; decrement DiceLeft accordingly.

23
Q

What initializations occur before counting dice in Zilch?

A

Set Score to 0 and set each Totals(X) to 0 using a FOR loop.

24
Q

What is the purpose of indentation in pseudocode?

A

To show the code included within a structure like a loop or a branch.

25
What is the advice about producing pseudocode in your program editor?
Don't produce pseudocode in your program editor; plan separately.