1.2.4 - Types of Programming Language Flashcards
State the four addressing modes.
Immediate Addressing.
Direct Addressing.
Indirect Addressing.
Indexed Addressing.
In LMC, the STA mnemonic stands for _____. What is the function of this?
In LMC, the STA mnemonic stands for “store”.
This stores the value in the accumulator at the given memory address.
Identify the four main programming structures used in structured programming.
Sequence.
Selection.
Iteration.
Recursion.
In LMC, the BRP mnemonic stands for _____. What is the function of this?
In LMC, the BRP mnemonic stands for Branch if Positive.
This branch is conditional, given that the value in the accumulator is positive.
State an advantage of procedural programming.
It can be applied to wide range of problems.
Procedural programming is relatively easy to write and interpret.
What are programming paradigms?
Programming paradigms are different approaches to using a programming language to solve a problem.
In LMC, the BRA mnemonic stands for _____. What is the function of this?
In LMC, the BRA mnemonic stands for Branch Always.
This branch is unconditional, and will always branch to the given address.
Which two MAIN categories are programming paradigms categorised into?
Programming paradigms are split into either:
- Imperative
- Declarative.
In LMC, the BRZ mnemonic stands for _____. What is the function of this?
In LMC, the BRZ mnemonic stands for Branch if Zero.
This branch is conditional, given that the value in the accumulator is 0.
State one use of declarative programming.
Expert systems.
Knowledge-based systems.
Artificial Intelligence.
How does assembly language differ from machine code?
Assembly language uses mnemonics, rather than the standard binary. One line in assembly language is equivalent to one line in machine code.
State the function of the opcode and the operand.
The opcode specifies the instruction that needs to be performed. The opcode also identifies the addressing mode that needs to be used.
The operand holds the value which is related to the data, on which the instruction is to be performed.
Give one disadvantage of object oriented languages. (OOL)
- OOL require a different style of thinking which can be difficult for programmers to get used to, as they may be accustomed to other paradigms to pick up.
- OOP may not be suited to all types of problems.
- It isn’t logical to use OOP for small scale problems.
What is Encapsulation?
Encapsulation is the process of keeping an object’s attributes private so they can only be accessed and changed via public methods
What is Polymorphism?
Polymorphism means that objects of different types can be treated in the same way
What is a programming language?
A programming language is a set of commands, instructions and other syntax that is used to create a software program.
What is a low level language?
A language which is close to machine code. It is related closely to the design of the machine. This can be referred to as a “One to one” language.
What is machine code?
A set of all possible instructions made available by the hardware design of a particular processor. Machine code is the closest to pure binary?
Who created LMC, and when?
Dr. Stuart Madnick, in 1965.
(icl you probs don’t need to know this but it was on some sheet that sir gave us)
Define a class.
A template defining methods and attributes used to make objects
Define an object.
An instance of a class.
Define a base class.
Contains the attributes and methods. It is the highest class and doesn’t inherit anything from any other class. (Think of the base class as the main class)
What is a superclass?
A class that has been extended by another class. It allows the extending class to inherit it’s attributes of the class it extends.
What is a subclass?
A class that extends another class. The subclass inherits the methods and attributes of the class that it extends.
What is a derived class?
A derived class is any class that inherits attributes and methods from any other derived class or base class.
Define instantiation.
The process of creating an actual named instance of class. The instantiated named copy of the class in an object of that class.O
What is overriding?
A method in a subclass or derived class which has the same name as a method in one or more of it’s superclass’s. The method supersedes all other versions of the other method above it in the inheritance tree. (Mark Scheme Answer [2 Marks]))
What is a method?
A program routine contained within an object designed to perform a particular task on the data within the object. A method could be a procedure, or a function.
State the definition of an attribute.
A single bit of data within a record.
Define encapsulation.
All of the objects attributes are contained and hidden in the object, and access to them is restricted to the operations of that class.
Define polymorphism.
A specialised form of overloading which allows us to create very general object structures, which can be used with a wide range of data types.