Topic 2 - Programming Flashcards

1
Q

What is readability?

A

How easily program code can be understood.

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

What are three ways of enhancing readability?

A
  1. Comments
  2. Descriptive Variable Names
  3. Indentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an error?

A

An occurrence of an unexpected result.

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

What are three types of errors?

A
  1. Logic (when results are different than expected)
  2. Syntax (structure and rules of program code)
  3. Runtime (Occurs during or after program execution)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Test Plan?

A

A document outlining the stages of the testing process.

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

In a test plan, what are three categories that test data is usually put into?

A
  1. NORMAL (typical inputs)
  2. BOUNDARY (not so typical inputs)
  3. ERRONEOUS (inputs that just don’t work)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Trace Table?

A

A method used to test for Logic Errors

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

What is an Integrated Development Environment (IDE) ?

A

An application that provides a selection of tools for programmers whilst coding.

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

What is debugging?

A

The process of finding and removing errors.

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

What is a Watcher?

A

A tool that ‘watches’ anything specified by the programmer.

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

What is a Breakpoint?

A

A tool that allows a programmer to halt the programmer’s execution at specified points.

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

What is ‘Stepping’ ?

A

The process of executing the program line by line.

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

What are four factors that make up a good program?

A
  1. Correctness
  2. Efficiency
  3. Robustness
  4. Understandability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What two purposes does Declaration serve?

A
  1. To reserve memory space

2. To ensure the compiler interprets and uses instructions correctly

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

What is a Command?

A

Instructs the computer to do something specific.

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

What is a Conditional?

A

A statement that evaluate to True or False (Boolean)

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

What are the three types of Control Constructs?

A
  1. Sequence
  2. Selection
  3. Repetition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does a Sequence Construct work?

A

Each line follows the previous line (all lines are executed)

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

How does a Selection Construct work?

A

Decisions are made that choose the program’s execution

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

How does a Repetition Construct work?

A

Code is repeated (looped) until specified conditions are met.

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

What are the 5 Data Types?

A
  1. Integers (Whole numbers)
  2. Float (decimal point / fractional point)
  3. Boolean (one of two values)
  4. Character (letter, number, symbol)
  5. String (sequence of characters)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a variable?

A

A location in the memory containing data values.

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

What are Constants?

A

Identifiers associated with values that remain fixed during the program’s execution.

24
Q

Why are variables used?

A

Allows you to store a value that can be used later on.

25
Q

What are three advantages of using Constants?

A
  1. Improves readability
  2. Ability to update
  3. Compiler Optimisation
26
Q

What is a Data Structure?

A

The conceptual arrangement of data.

27
Q

What is an Array?

A

A data structure which stores data under a single identifier name by index position.

28
Q

What are the two types of arrays?

A

One-dimensional arrays and two-dimensional arrays.

29
Q

How does a 1D array store data?

A

In one horizontal direction

30
Q

How does a 2D array store data?

A

Horizontally and vertically

31
Q

What are the 3 ways of manipulating strings?

A
  1. Position
  2. Concatenation
  3. String Conversion Operations
32
Q

In terms of hardware, what do I/O devices do?

A

They transfer data to and from a computer.

33
Q

In terms of software, what is an input and an output?

A

Inputs introduce data to a program.

Outputs transfer data to something outside of the program.

34
Q

What is a file?

A

A collection of data with a name, usually stored on a computer.

35
Q

What is validation?

A

Ensuring the data the user inputs is sensible and usable,

36
Q

What are the 4 types of validation?

A
  1. PRESENCE CHECK: Checks data that has actually been inputted.
  2. DATA TYPE CHECK: Checks whether the data type entered is correct.
  3. RANGE CHECK: Checks that the data inputted is within a set range
  4. LENGTH CHECK: Checks the length.
37
Q

What is a User Interface?

A

The space where interaction between humans and machines occur.

38
Q

What are the two types of User Interfaces?

A
  1. Textual User Interface (TUI) - interaction through lines of text.
  2. Graphical User Interface (GUI) - interaction through graphical icons.
39
Q

What are Cartesian Coordinates?

A

Positioning of something on a screen. (2D / 3D)

40
Q

What are Arithmetic Operators?

A

They take numerical values as the operands, and produce a single numerical value.

41
Q

What are the 5 types of Arithmetic Operators?

A

Addition, Subtraction, Division, Multiplication, Modulus

42
Q

What are Relational Operators?

A

These operations compare two operands to determine their relationship, and evaluate to a Boolean value.

43
Q

What are the 6 types of Relational Operators?

A

Equal to, Not equal to, Less than, Greater than, Less than or equal to, Greater than or equal to

44
Q

What are Boolean Operators?

A

Used to manipulate True/False values in Boolean algebra

45
Q

What are the three types of Boolean Operators?

A

NOT, AND, OR

46
Q

What is a Subprogram?

A

A block of code that performs a specific task.

47
Q

What are parameters?

A

Variables within a function.

48
Q

What are arguments?

A

The data that is passed on into subprograms.

49
Q

What are the two types of subprograms?

A

Functions (returns a value) and Procedures (may/may not return a value)

50
Q

What are libraries?

A

Collections of additional subprograms that often tackle more complex and specific tasks.

51
Q

What are pre-existing subprograms?

A

Subprograms that have been coded by someone else and are often pre-compiled

52
Q

Why are pre-existing subprograms useful? (4 benefits)

A
  1. Perform generalisation (decreases complexity)
  2. Ability to reuse code
  3. Decomposes a problem
  4. Saves time
53
Q

What are the two types of variables?

A

Global Variables and Local Variables

54
Q

What are Global Variables?

A

Variables declared outside of a subprogram and can be accessed anywhere from a program.

55
Q

What are Local Variables?

A

Variables declared within a subprogram and can only be accessed there.