1.2.2 Flashcards
(32 cards)
What is the purpose of an algorithm?
To provide a step-by-step procedure for solving a problem.
True or False: A flowchart is a visual representation of an algorithm.
True
Fill in the blank: An algorithm must have a defined ____ and ____.
input; output
What is a variable in programming?
A storage location identified by a name that holds a value.
What does the term ‘iteration’ mean in programming?
The repetition of a process or set of instructions in a program.
Multiple Choice: Which of the following is NOT a data type? A) Integer B) String C) Loop D) Boolean
C) Loop
What is a conditional statement?
A statement that executes a particular action based on whether a condition is true or false.
True or False: A list is a type of data structure that holds an ordered collection of items.
True
What is meant by ‘syntax error’?
An error that occurs when the code violates the rules of the programming language.
Fill in the blank: The ____ loop continues until a specified condition is met.
while
What is the purpose of a function in programming?
To encapsulate a block of code that performs a specific task and can be reused.
Multiple Choice: Which of the following is a valid variable name? A) 1stVariable B) first-variable C) firstVariable D) first variable
C) firstVariable
What does ‘debugging’ refer to?
The process of finding and fixing errors in code.
True or False: A Boolean data type can only hold true or false values.
True
What is pseudocode?
A method of designing algorithms using informal language that resembles programming code.
Fill in the blank: A ____ is a collection of related data items.
record
What is the difference between ‘syntax’ and ‘semantics’ in programming?
Syntax refers to the structure of the code, while semantics refers to the meaning of the code.
Multiple Choice: Which of the following is used to store multiple values in one variable? A) Integer B) Array C) String D) Boolean
B) Array
What is an ‘if statement’ used for?
To execute code only if a specified condition is true.
True or False: A ‘for loop’ is typically used when the number of iterations is known.
True
What does ‘API’ stand for?
Application Programming Interface
Fill in the blank: A ____ is a named block of code that can be executed by calling it.
function
What is the role of comments in code?
To provide explanations and notes for anyone reading the code.
Multiple Choice: Which of the following is an example of a programming language? A) HTML B) CSS C) Python D) SQL
C) Python