Exam Questions Flashcards

(2 cards)

1
Q

What is a sub-procedure?

A

A sub-procedure is a named, reusable block of code within a program that performs a specific task. In pseudocode, it helps break down a program into smaller, manageable parts, improving readability and reducing repetition. It can be called multiple times to avoid code repetition and improve modularity. Sub-procedures do not return a value, unlike functions which do.

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

What is the difference between an array and a collection?

A

An array is a fixed-size, ordered data structure that stores elements of the same data type, accessed by index.

A collection is a dynamic data structure that can grow or shrink in size and may store elements of different types, depending on the context.

Arrays are static and indexed; collections are flexible and often used for more complex data handling.

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