Programming Flashcards

1
Q

Define the term ‘algorithm’

A

An algorithm is a step-by-step set of instructions designed to perform a specific task or solve a particular problem.

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

Explain what is meant by ‘decomposition’

A

Decomposition refers to the process of breaking down a complex problem into smaller, more manageable sub-problems or tasks.

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

Explain what is meant by ‘abstraction’

A

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.

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

Interpret pseudocode

A

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.

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

Write pseudocode

A
  1. Start
  2. Input a number
  3. If the number is greater than 10, then
  4. Display “Number is greater than 10”
  5. Else
  6. Display “Number is less than or equal to 10”
  7. End If
  8. Stop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Identify inputs, processes, and outputs within a given algorithm

A

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.

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

Describe the purpose of a given algorithm

A

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.

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

Describe what is meant by ‘data type’

A

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.

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

Define ‘integer’

A

A data type that represents whole numbers without any fractional part.

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

Define ‘real’

A

A data type that represents numbers with a fractional part.

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

Define ‘Boolean’

A

A data type that represents true or false values.

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

Define ‘character’

A

A data type that represents a single character, such as a letter, digit, or symbol.

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

Define ‘string’

A

A data type that represents a sequence of characters.

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

Describe ‘iteration’

A

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.

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

Describe ‘selection’

A

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.

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

Use and explain definite (count-controlled) iteration

A

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.

17
Q

Use and explain indefinite (condition-controlled) iteration

A

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.

18
Q

Use and explain nested structures

A

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.

19
Q

Explain the need for meaningful identifiers

A

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.

20
Q

Explain the need for meaningful identifiers

A

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.

21
Q

constants and variables

A

Constants are values that don’t change, like pi (π). Variables are values that can change, like score or name.