AS10 Flashcards
1
Q
Procedural Programming Paradigm
A
- Works sequentially.
- Program intended to be run one line after another.
- Simplest type.
- Starting points for beginners.
- Not good for building GUIs (unpredictable).
- E.g. BASIC, C.
2
Q
Event-Driven Programming Paradigm
A
- Used when the program relies heavily on user interaction.
- Program will sit in a loop waiting for the user to perform an action.
- A function (listener) will then process that event. Developers responsible for creating this code.
- Requires the programmer to think about their code in a non-linear fashion.
- E.g. Java, Python.
3
Q
Visual Programming Paradigm
A
- Makes use of intuitive user interface rather than a reliance on text.
- Drag/Drop blocks of code.
- Don’t have to learn off syntax.
- Not ideal for larger problems.
- Interface will take up lots of space, limiting the developer in viewing their code.
- Slow for experienced developers.
- E.g. Scratch.
4
Q
Mark-up Languages
A
- Commands applied to a text document to give instructions on how to interpret or display the text.
- commands surrounded by chevrons, creating tags.
- Combined with other languages, most common JavaScript and HTML.
- JavaScript will process the interactions, HTML will format the output.
- E.g. HTML.
5
Q
Object-Oriented Languages
A
- Creates objects to represent real world entities.
- Elements of procedural are also available. (identifiers, assignment, constants, selection, iteration.)
- Procedures are replaced by classes, objects and methods.
6
Q
Class
A
- Defines the methods and attributes for a group of similar objects.
- A template for an object.
- Can inherit attributes and methods from other classes.
7
Q
Object
A
- An instance of a class.
- Represents a real world object.
- Control how other objects interact with themselves, preventing errors.
8
Q
Attributes
A
- Properties of a class or object.
9
Q
Public
A
- sign.
- Any class can access the attribute/call the method.
10
Q
Private
A
- sign.
- Only the current class can access the attribute/call the method.
11
Q
Protected
A
- # sign.
- Only the current class/subclasses can access the attribute/call the method.
12
Q
Encapsulation
A
- Tecnical implementation is hidden within the object.
- Keeps code and data from outside misuse.
- Storing data/funtions in a single unit is encapsulation.
- Data cannot be accessed outside the class/only functions inside the class can access it.
13
Q
Inheritance
A
- Properties/Methods are copied to another class, supporting hierarchal classification. (otherwise, each object would need to explicitly define its characteristics)
- An object only needs to define qualities that make it unique.
14
Q
Polymorphism
A
- An operation may exhibit different behaviours in different instances.
- Allows for one instance to be used for a general class of actions.
- Reduces complexity as a generic interface can be used for a group of related activities.
- The complier selects the specific method that applies to each situation.
15
Q
OOP Advantages
A
- Provides a clear modular structure, making it good for defining abstract data types where implementation details are hidden.
- Easy to maintain/modify existing code as new objects can be created with small differences to existing ones.
- Provides a good framework for code libraries where software components can be easily modified.
16
Q
High-Level Languages
A
- Use a human syntax.
- Need to be decoded before executed.
- Portable.
- Declarative, object-oriented and procedural.
- Easy to write, debug, maintain.
- Less error prone.
- Additional translation times.
17
Q
Low-Level Languages
A
- Machine oriented.
- Operation + operand = instruction.
- Not portable; CPU specific.
- Simple.
- Hard to program directly.
-Mnemonics are used.
-Allow for close control of the CPU. - Efficient.