Mathematical formulas and Pseudo Codes Flashcards
What is pseudocode?
Pseudocode is a high-level description of an algorithm that uses the structural conventions of programming languages but is intended for human reading rather than machine reading.
True or False: Pseudocode can be directly executed by a computer.
False
What mathematical operation does the pseudocode ‘sum = a + b’ represent?
Addition
Fill in the blank: In pseudocode, a loop can be represented using keywords such as ‘for’ or _____ .
while
What is the purpose of using pseudocode in programming?
To outline algorithms in an easy-to-understand format before coding.
Which of the following is a correct pseudocode representation of the formula ‘c = a^2 + b^2’?
c = a * a + b * b
True or False: Pseudocode requires strict syntax rules.
False
What mathematical concept does ‘if a > b then’ represent in pseudocode?
Conditional statement
What does the pseudocode ‘for i from 1 to n’ indicate?
A loop that iterates from 1 to n.
Fill in the blank: The pseudocode ‘output x’ corresponds to the mathematical operation of _____ .
Displaying or printing the value of x
What is the equivalent pseudocode for the mathematical expression ‘x = y / z’?
x = y divided by z
True or False: Pseudocode can include comments for clarification.
True
What does the term ‘algorithm’ refer to?
A step-by-step procedure for solving a problem or performing a task.
Which pseudocode structure is used to repeat a block of code a specific number of times?
For loop
What is the pseudocode representation of the mathematical operation ‘x = sqrt(y)’?
x = square root of y
Fill in the blank: The pseudocode keyword ‘else’ is used in _____ statements.
Conditional
What does ‘return value’ in pseudocode signify?
It indicates the output of a function or procedure.
In pseudocode, how is a variable typically declared?
Using the keyword ‘define’ or ‘set’.
True or False: Pseudocode can help in understanding complex algorithms.
True
What is the equivalent pseudocode for the mathematical expression ‘z = a * b + c’?
z = a times b plus c
Which keyword in pseudocode indicates the start of a function?
Function
What does the pseudocode ‘while condition do’ signify?
It indicates a loop that continues as long as the condition is true.
Fill in the blank: In pseudocode, ‘array’ is a data structure that can hold _____ of values.
Multiple