Programming Flashcards
Define the term ‘algorithm’
An algorithm is a step-by-step set of instructions designed to perform a specific task or solve a particular problem.
Explain what is meant by ‘decomposition’
Decomposition refers to the process of breaking down a complex problem into smaller, more manageable sub-problems or tasks.
Explain what is meant by ‘abstraction’
Abstraction involves focusing on the essential details while ignoring unnecessary complexities. It allows us to represent real-world problems in a simplified manner, emphasizing only the relevant aspects needed to understand or solve the problem.
Interpret pseudocode
Pseudocode is a high-level description of a computer program or algorithm written in plain English or a mixture of natural language and informal programming syntax.
Write pseudocode
- Start
- Input a number
- If the number is greater than 10, then
- Display “Number is greater than 10”
- Else
- Display “Number is less than or equal to 10”
- End If
- Stop
Identify inputs, processes, and outputs within a given algorithm
Inputs are the data provided to the algorithm at the beginning. Processes are the steps or operations performed on the input data. Outputs are the results produced by the algorithm after processing the input.
Describe the purpose of a given algorithm
The purpose of an algorithm is to solve a specific problem or perform a particular task efficiently and accurately by following a predefined set of steps.
Describe what is meant by ‘data type’
A data type defines the type of data that a variable can hold. It specifies the range of values that the variable can take and the operations that can be performed on it.
Define ‘integer’
A data type that represents whole numbers without any fractional part.
Define ‘real’
A data type that represents numbers with a fractional part.
Define ‘Boolean’
A data type that represents true or false values.
Define ‘character’
A data type that represents a single character, such as a letter, digit, or symbol.
Define ‘string’
A data type that represents a sequence of characters.
Describe ‘iteration’
Iteration involves repeating a set of instructions or a block of code multiple times until a specific condition is met or for a specified number of times.
Describe ‘selection’
Selection, also known as conditional statements, involves making decisions based on certain conditions. It allows the program to execute different sets of instructions based on whether a condition is true or false.
Use and explain definite (count-controlled) iteration
Definite iteration involves executing a loop for a specific number of times, known in advance. It typically uses a counter variable to control the number of iterations.
Use and explain indefinite (condition-controlled) iteration
Indefinite iteration involves executing a loop as long as a specific condition remains true. The number of iterations is not predetermined and depends on the condition being evaluated.
Use and explain nested structures
Nested structures involve placing one loop or decision-making construct inside another. This allows for more complex control flow and solving problems that require multiple levels of iteration or selection.
Explain the need for meaningful identifiers
Meaningful identifiers, such as variable names and function names, make code more readable and understandable. They convey the purpose or meaning of the entity they represent, improving code maintainability and reducing the chances of errors.
Explain the need for meaningful identifiers
Meaningful identifiers, such as variable names and function names, make code more readable and understandable. They convey the purpose or meaning of the entity they represent, improving code maintainability and reducing the chances of errors.
constants and variables
Constants are values that don’t change, like pi (π). Variables are values that can change, like score or name.