Programming Key Terms Flashcards

1
Q

Define the term algorithm.

A

An algorithm is a set of instructions that performs a task.

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

What are the different types of data types?

A

Char
Boolean
Integer
Float
String

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

What is a constant?

A

A constant is a variable that can never be altered.

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

Give the pseudocode for printing “Hello World”

A

OUTPUT “Hello World”

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

Give the pseudocode for asking the user to input a string, and store it in the variable ‘string’.

A

string <– USERINPUT

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

What does the DIV operator do?

A

Gives an integer for every division, or the quotient.

10 DIV 4 = 2

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

What does the MOD operator do?

A

Returns the remainder of the operation.

3 MOD 2 = 1

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

What is the key term for converting a variable from one data type to another?

A

Casting

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

How can we convert a string to an integer in pseudocode?

A

STRING_TO_INT(variablename)

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

What are comments for in a program?

A

Describes the purpose of the program and helps other programmers understand the program

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

What is sequence?

A

Lines of code that are executed in order

OUTPUT “Hello”
OUTPUT “World”

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

What is selection?

A

A statement where a certain condition must be met

IF var = TRUE THEN
OUTPUT “TRUE”
ENDIF

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

What is iteration?

A

Repetition of a section of code.
For loop
While loop
REPEAT UNTIL loop (pseudocode)

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

Write the pseudocode for finding a random integer between 1 and 6, and store it in a variable.

A

var = RANDOM_INT(0, 6)

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

What is an array?

A

A data structure that can store multiple items of data of the same data type.

An array has a fixed length.

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

How do indexes work?

A

Indexes start from 0, for example array[0] would be the first item in the array

17
Q

How can an array be declared in pseudocode?

A

array nameofarray[20]

An array has been created of length 20

18
Q

Print “Hello World” 10 times using a for loop in pseudocode.

A

FOR i <– 0 TO 10:
OUTPUT “Hello World”
ENDFOR

19
Q

What are functions and procedures an example of ?

A

Subroutines

20
Q

What is a function?

A

A function will always return a value after processing takes place

21
Q

What is a procedure?

A

A procedure executes code in a subroutine but does not execute anything

22
Q

What is a subroutine?

A

A named, self-contained section of code that performs a specific task

23
Q

What are parameters?

A

Parameters are values that can be entered into a subroutine that are processed.

e.g. SUBROUTINE add(a, b)
total <– a + b
return total
ENDSUBROUTINE

a and b are parameters in this subroutine

24
Q

What are the advantages of subroutines in a program?

A

Break down a large section of code into smaller, more manageable sections (decomposition)

Can be used multiple times easily

Each one can be tested separately, making it easier to debug

Splits the workload

Easier to change is requirements become different

25
Q

What is data validation?

A

Data validation ensures that data is of the right type, e.g. data must be between 3 and 7 characters long, or data must be an integer

26
Q

What are the different types of validation?

A

Presence check - if data has been entered
Type check - if data is a integer, or string
Format check - if an email address is
formatted correctly
Length check - if data is of the right length
Range check - if data is between the right length

27
Q

What is authentication?

A

Authentication routines are used to check that someone is who they claim to be.

28
Q

What is a local variable?

A

A local variable is a variable declared within a subroutine that is not recognised anywhere else in the program

29
Q

What is a global variable?

A

A variable that is declared in the main program and is recognised in a subroutine.

30
Q

What are trace tables used for?

A

Trace tables are used to determine the output of a program, or the purpose of a program, or try and find errors in a program

31
Q

What is a syntax error?

A

An error where the code written does not conform to the rules of the language

32
Q

What is a logical error?

A

The program runs but does not work as the programmer intended.

33
Q

What are the three different types of data tests?

A

Normal data - typical data that will work
Erroneous data - data that will cause an err
Boundary data - data that test the boundary e.g. between 1, and 10, testing with 1.

34
Q

What is abstraction?

A

The removing of unnecessary details in order to solve a problem.

35
Q

What is abstraction?

A

The removing of unnecessary details in order to solve a problem.