Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the characteristics of the Float data type?

A
  • Can store numbers with decimal points.
  • Are not exact.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the characteristics of an Array?

A
  • List of values of the same data type
  • Each object is called an array element
  • Difficult to change array length
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the characteristics of a Record?

A
  • Holds data in fields that can be different data types
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Global Variable?

A

A variable that’s value can be accessed throughout the entire program/code.

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

What is a Local Variable?

A

A variable that’s value can only be accessed within a specific module/function.

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

What are the 3 Control Structures?

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

What are the 3 types of Selection?

A
  • One-way selection means choosing do an action or do nothing.
  • Two-way selection means choosing to do one action or an alternate action.
  • Multi-way selection means choosing between many actions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 3 types of Iteration?

A
  • While: Test first, number of iterations is not known.
  • For Next: Test first, repeats a counted or fixed number of times.
  • Repeat… Until: Test last, is executed at least once.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a stub?

A

A simple program routine/module that stands in for a more complex routine to be written at a later date.

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

What is Modularisation?

A

A strategy to reduce coupling in a computer program, mostly by means of encapsulation.

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

What is a Function?

A

A special type of module with no inputs or outputs that returns a single value through the function’s name.

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

What is a Logical Error?

A

Program does not function how it is intended and/or outputs data that is incorrect.

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

What is a Run-Time Error?

A

Program crashes during execution. Can be caused by dividing by zero and/or use of incorrect data types.
Program was made correctly, compiled correctly, but cant follow instructions.

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

What is Syntax Error?

A

The correct language conventions have not been adhered to - program is not able to execute. E.g. Not closing a bracket when print out text in Python.

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

What is the purpose of Internal Documentation?

A

Purpose is to provide comments and explanations on what the code is doing. This helps other coders working on the project to contribute and/or modify when required.

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

What is the purpose of External Documentation?

A

Provide documents that will support users of the software. E.g. Installation Guide.

17
Q

What is Type Checking?

A

Ensure that the correct data type is entered into a program. This will prevent run-time errors such as trying to add a string with an integer.

18
Q

What is Range Checking?

A

Used to validate data so that it is logical and has a high level of integrity.

19
Q

What is a Statement (programming)?

A

A single line of code that performs a specific task.

20
Q

What is Pass-By-Value?

A

The value of the parameter/variable can change within a module but the changed value is not passed back out to the main module.

21
Q

What is Pass-By-Reference?

A

The value of the parameter/variable can change within a module. The changed value is passed back out to the main module

22
Q

What is Source Code?

A

The code created by the programmer, usually in text, human-readable and formatted in a way that developers and other users can understand.

23
Q

What is Executable Code?

A

Machine code instructions for a specific physical processor.

24
Q

What is Byte Code?

A

Opcodes or 1 byte instructions written for a software interpreter. Can use same opcodes on different platforms.

25
Q

What is a Compiler? What are some advantages and disadvantages?

A

A compiler scans the entire program and translates it as a whole into machine code.
*Faster overall execution time
*Has to recompile after each change

26
Q

What is an Interpreter? What are some advantages and disadvantages?

A

An interpreter, on the other hand, translates the program one statement at a time.
*Slower overall execution time
*More computationally expensive