1.2.2 Flashcards

(32 cards)

1
Q

What is the purpose of an algorithm?

A

To provide a step-by-step procedure for solving a problem.

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

True or False: A flowchart is a visual representation of an algorithm.

A

True

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

Fill in the blank: An algorithm must have a defined ____ and ____.

A

input; output

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

What is a variable in programming?

A

A storage location identified by a name that holds a value.

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

What does the term ‘iteration’ mean in programming?

A

The repetition of a process or set of instructions in a program.

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

Multiple Choice: Which of the following is NOT a data type? A) Integer B) String C) Loop D) Boolean

A

C) Loop

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

What is a conditional statement?

A

A statement that executes a particular action based on whether a condition is true or false.

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

True or False: A list is a type of data structure that holds an ordered collection of items.

A

True

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

What is meant by ‘syntax error’?

A

An error that occurs when the code violates the rules of the programming language.

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

Fill in the blank: The ____ loop continues until a specified condition is met.

A

while

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

What is the purpose of a function in programming?

A

To encapsulate a block of code that performs a specific task and can be reused.

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

Multiple Choice: Which of the following is a valid variable name? A) 1stVariable B) first-variable C) firstVariable D) first variable

A

C) firstVariable

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

What does ‘debugging’ refer to?

A

The process of finding and fixing errors in code.

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

True or False: A Boolean data type can only hold true or false values.

A

True

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

What is pseudocode?

A

A method of designing algorithms using informal language that resembles programming code.

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

Fill in the blank: A ____ is a collection of related data items.

17
Q

What is the difference between ‘syntax’ and ‘semantics’ in programming?

A

Syntax refers to the structure of the code, while semantics refers to the meaning of the code.

18
Q

Multiple Choice: Which of the following is used to store multiple values in one variable? A) Integer B) Array C) String D) Boolean

19
Q

What is an ‘if statement’ used for?

A

To execute code only if a specified condition is true.

20
Q

True or False: A ‘for loop’ is typically used when the number of iterations is known.

21
Q

What does ‘API’ stand for?

A

Application Programming Interface

22
Q

Fill in the blank: A ____ is a named block of code that can be executed by calling it.

23
Q

What is the role of comments in code?

A

To provide explanations and notes for anyone reading the code.

24
Q

Multiple Choice: Which of the following is an example of a programming language? A) HTML B) CSS C) Python D) SQL

25
What is a 'loop' in programming?
A construct that repeats a block of code multiple times.
26
True or False: A constant is a variable whose value can change during program execution.
False
27
What is 'recursion' in programming?
A process where a function calls itself to solve a problem.
28
Fill in the blank: The ____ statement is used to exit a loop or function.
break
29
What is the main purpose of using a 'switch statement'?
To simplify the process of writing multiple conditional statements.
30
Multiple Choice: In which part of a program is data typically stored? A) Input B) Output C) Storage D) Processing
C) Storage
31
What is a 'syntax error'?
An error that occurs when the code does not conform to the rules of the programming language.
32