1.2.4 Types of Programming Language Flashcards
Define programming paradigm
A style of programming
Define procedural programming
When every variable, constant, and subroutine is defined separately, with no relationship between them
Define object-orientated programming
Separate objects are defined with their own subroutines and values
Define a constructor
A method that creates an object of a particular class with its own attributes
Define a static attribute or method
Attributes or methods relevant to a whole class
Define a non-static attribute or method
Attributes or methods that are relevant to only the object
What are some features of procedural programming?
- The programmer specifies steps needed to be executed
- The order of the steps is up to the programmer
- Statements can be grouped into procedures and functions
What are some features of object-orientated programming?
- The programmer can design self-contained objects
- Each object contains methods and the data that is being processed
- The program is split into smaller units (objects)
- Objects can be reused and inherited easily
What are some features of assembly language?
- Low-level language
- Has a one-to-one relationship with machine code
- Uses mnemonics to represent machine code
- Specific to a processor
Define homogeneous elements
All elements have the same data type
Define heterogeneous elements
Elements can have different data types
What is the typical size and explanation of an integer data type?
2 or 4 bytes
A whole numerical value
What is the typical size and explanation of a real/float data type?
4 or 8 bytes
A decimal value
What is the typical size and explanation of a string data type?
Usually 1 byte per character
A set of character and/or numbers
What is the typical size and explanation of a boolean data type?
1 bit
Can be one of two values
What is the typical size and explanation of a character data type?
1 byte
A single letter, digit, or symbol
What is the typical size and explanation of a date/time data type?
1 byte per date or time
A value that states the date or time:
DD/MM/YYYY or hh:mm:ss
What is the typical size and explanation of a currency data type?
8 bytes
A real/float value which is told which currency symbol to assign to it
What is the basic structure of a 16-bit machine code instruction?
Opcode (operation code): basic machine operation (6 bits) and addressing mode (2 bits)
Operand
ADD: instruction, numeric code, and description
ADD
1xx
Adds the contents of the memory address to the Accumulator
SUB: instruction, numeric code, and description
Subtract
2xx
Subtracts the contents of the memory address to the Accumulator
STA: instruction, numeric code, and description
Store
3xx
Stores the contents of the Accumulator to the memory address
LDA: instruction, numeric code, and description
Load
5xx
Loads the contents of the memory address to the Accumulator
BRA: instruction, numeric code, and description
Branch always
6xx
Branches to the instruction in the memory address
BRZ: instruction, numeric code, and description
Branch if zero
7xx
Branch if the contents of the Accumulator is 000 to the instruction in the memory address
BRP: instruction, numeric code, and description
Branch if positive
8xx
Branch if the contents of the Accumulator is positive to the instruction in the memory address
INP: instruction, numeric code, and description
Input
901
Input data which is copied to the Accumulator