Programming Tecniques Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is Inheritance?

A

This is where a class can inherit an attribute from the super class. A subclass can also inherit from a class. The attributes that it will inherit will be the same as the class but they can be altered and not effect the original from the super class. This can be used to create similar objects/instances that use similar attributes but have slight variation within their attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Encapsulation?

A

This is where the properties of a class can be set to either public or private. This allows an element of security within the code, so that attributes cannot be accessed without going through the class or subclass itself. Inheritance opens the class to access the details, therefore it breaks the encapsulation in order to access it, making it vulnerable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Polymorphism?

A

Polymorphism processes objects that can take on different forms within the code, such as variables, functions or classes. This allows people to code programs which can be more flexible and allow people to code generic classes instead of specific classes. It can be with inheritance and without inheritance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Recursion?

A

Recursion is a function that calls itself from within its self.
Recursion uses a stack format, so it stores all the outputs that have been returned. This can take up a lot of memory. In the function’s start up within the brackets, variables can be set up and used within the code. Variables can be passed into the function as a copy. The values are returned at the end of the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Procedural Programming?

A

These languages are run in sequence. The control flow of the program can be altered to make sure that certain functions and code sequences are run in different orders or repeated with ifs and loops.

They are best used for general purpose programming due to their lower skill ceiling required to learn them.

This type of code is portable, as it can be compiled for other systems and cpu types.

There is an abundance of procedural languages, making it harder to choose which one to use.

Depending on how much code there is, t is significantly harder to debug due to everything not being as organised as OOP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Object Oriented Programming?

A

Object oriented use objects that can communicate together to provide a more efficient code system.

Classes can be easily tested to provide a working piece of code. People don’t even know how each class works, they just need to know how to use it.

Because of it’s modular design with different objects and classes it makes it significantly easier to work in a group.

OOPs are significantly harder to learn, due to their significantly steeper learning curve.

Although it can be more efficient, it still isn’t as efficient as lower level coding languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Assembly language?

A

Assembly languages replace Mnemonics, which are short few letter instructions that are easier to remember.

This language is more memory efficient as instructions are much shorter. The code and program runs significantly faster than any other type.

However even though it has simpler instructions, it can still be rather complex to produce a program from it.

Each storage location has to be detailed in order to run the program effective and correctly. Having a better knowledge of the CPU will make this easier however.

The code isn’t as portable as it can only really work for one CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an Addressing Mode?

A

An Addressing mode refers to how you are addressing memory in a given location

There are many ways to locate data and instructions in memory and these methods are called memory address modes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Immediate Addressing?

A

This is where the name is the value that will be stored in memory immediately flows the operation code in memory. This means that the data to be used is hard coded into the instruction itself .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Direct Addressing?

A

Direct addressing has the name as the value that will be accessed in memory, is obtained by directly retrieving it from another. Direct addressing memory means the code refers directly to a location in memory, this it the most common form of addressing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Indirect Addressing?

A

This is where the address of the data is held in an intermediate location so that the address is first looked up and then used to locate the data itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Indexed Addressing?

A

Uses a base address to a block of data, then an index is used from this address to access various parts of the block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the Stages of Compilation?

A

lexical analysis
syntax analysis
code generation
optimisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a Method?

A

A Procedure that will run a specific function, Data can be passed into it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an Attribute?

A

This is another name for a variable, they hold data such as numbers ans string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly