Types of programming languages - paper 1 Flashcards
What are the two types of programming paradigms?
Imperative and declerative
What is imperative programming?
Uses code that clearly specifies the actions to be performed e.g procedural and OOP
What is declarative programming?
States the desired result rather than the exact instructions required to be performed to get there.
How do you add in LMC?
ADD
How do you subtract in LMC?
SUB
How do you store a value from the accumulator to a memory location in LMC?
STA
How do you load a value from a memory location to the accumulator in LMC?
LDA
How do you get a user to input a number in LMC?
INP
How do you print a value that is in the accumulator in LMC?
OUT
How do you stop a set of code from running in LMC?
HLT
How do you create a flag with a label at which data is stored?
DAT
How do you branch if the value in the accumulator is zero in LMC?
BRZ
How do you branch if the value in the accumulator is positive in LMC?
BRP
How do you branch no matter what in LMC?
BRA
What are the advantages of OOP?
A high level of reusability
Inheritance and polymorphism can be used
Encapsulation can be used to protect attributes
Modular structure so easy to maintain and update
High level of abstraction that is not necessary for programmers to know how to use.