1.2.4. Types Of Programming Languages Flashcards
What does it mean by Polymorphism?
Objects can be interpreted differently depending on their class or data type. Static - overloading = passing different parameters into a method Dynamic - overriding = redefining a Method within a subclass and altering the code so it functions differently and produces a different output.
Immediate Addressing Mode
The value in the data part is the actual value that is needed to be used.
What are methods?
Actions that a class or object can perform.
What does it mean by encapsulation?
When attribute is made private. Public methods are used to read and amend the attributes value.
It is used to hide the values or internal state of An object preventing direct access by unauthorised parties.
Reduces human error as the user will have to go through its methods first before the attribute can be amended.
Define Programming Paradigms
To describe a way of doing things.
Different approaches to using a programming language to solve a problem.
Machine code
Binary values that translate into electrical signals (in transistors).
Indexed Addressing mode
The value in the data is a reference to a memory location. Add the value in the index register to the value in the memory location. This new value is a reference to a memory location that holds the value required for the instruction.
Define object orientated programming
Attempts to capture or group info and data and related functionality (code) into structured items known as objects.
Little man computer
ADD - add value from register to current value of acc
SUB - subtract value from a register to current value of acc
STA - load contents of register into acc
INP - requires user input
OUT - output value of acc
What is a class?
It is not an object itself. It is a template used to set or define what attributes and methods an object has. Once you have defined a class, you can easily reuse that class and create many objects of that class.
XXXX XXXX
? ?
- 8 bits
- first nibble is the instruction (opcode)
- second nibble is the data/address part (operand)
What is an object?
A group of info and data and related functionality (code) in structured items.
Each object is responsible for its own data and operations.
Define Procedural Programming
Consists of statements that tell the computer exactly what to do and is executed line by line.
It uses functions and procedures.
What does it mean by inheritance?
Subclasses inherit from a super class. Using inheritance you can reuse the code from a class and extend its methods and attributes as another class.
What is Assembly language?
- low level language that is one level above machine code.
- it used mnemonics making it easier to use. ( Each mnemonic is an abbreviation for machine code)
- commands for assembly language are processor specific.
- translated by a specific assembler. (one to one relationship)