Programming Flashcards
What are the characteristics of the Float data type?
- Can store numbers with decimal points.
- Are not exact.
What are the characteristics of an Array?
- List of values of the same data type
- Each object is called an array element
- Difficult to change array length
What are the characteristics of a Record?
- Holds data in fields that can be different data types
What is a Global Variable?
A variable that’s value can be accessed throughout the entire program/code.
What is a Local Variable?
A variable that’s value can only be accessed within a specific module/function.
What are the 3 Control Structures?
- Selection
- Sequence
- Iteration
What are the 3 types of Selection?
- 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.
What are the 3 types of Iteration?
- 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.
What is a stub?
A simple program routine/module that stands in for a more complex routine to be written at a later date.
What is Modularisation?
A strategy to reduce coupling in a computer program, mostly by means of encapsulation.
What is a Function?
A special type of module with no inputs or outputs that returns a single value through the function’s name.
What is a Logical Error?
Program does not function how it is intended and/or outputs data that is incorrect.
What is a Run-Time Error?
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.
What is Syntax Error?
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.
What is the purpose of Internal Documentation?
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.
What is the purpose of External Documentation?
Provide documents that will support users of the software. E.g. Installation Guide.
What is Type Checking?
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.
What is Range Checking?
Used to validate data so that it is logical and has a high level of integrity.
What is a Statement (programming)?
A single line of code that performs a specific task.
What is Pass-By-Value?
The value of the parameter/variable can change within a module but the changed value is not passed back out to the main module.
What is Pass-By-Reference?
The value of the parameter/variable can change within a module. The changed value is passed back out to the main module
What is Source Code?
The code created by the programmer, usually in text, human-readable and formatted in a way that developers and other users can understand.
What is Executable Code?
Machine code instructions for a specific physical processor.
What is Byte Code?
Opcodes or 1 byte instructions written for a software interpreter. Can use same opcodes on different platforms.
What is a Compiler? What are some advantages and disadvantages?
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
What is an Interpreter? What are some advantages and disadvantages?
An interpreter, on the other hand, translates the program one statement at a time.
*Slower overall execution time
*More computationally expensive