1.2.4) Types of Programming Language Flashcards

1
Q

What are programming paradigms?

A

Established conventions and practices which dictate how computers are structured and developed, offering varied methodologies for software construction.

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

What are the different types of programming paradigms?

A
  • Procedural
  • OOP
  • Assembly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a procedural language?

A

A type of language that structures code into a series of procedures or functions that are executed sequentially.

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

Strenths of procedural languages

A
  • Efficient for straight forward tasks
  • Clear and obvious flow
  • Easy to implement
  • Step by step
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Weaknesses of procedural languages

A
  • Unwieldly for large programs (clunky)
  • Lack of modularity can lead to code redundancy
  • Not ideal for complex applications
  • Difficult to scale
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Object-Oriented Programming?

A

A type of language that organizes code around “objects” rather than functions.

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

Strengths of OOP

A
  • Enhances modularity
  • Enables real-world modelling
  • Reusable code
  • Flexible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Weaknesses of OOP

A
  • Unnecessary complexity
  • Inefficiency
  • Not always applicable
  • Misuse can increase complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Assembly Language?

A

A low level representation of machine code for a specific computer architecture.

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

Strengths of Assembly language

A

Direct control over hardware
Optimized performance
Transparent about machine operation
Potentially efficient

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

Weaknesses of Assembly Language

A
  • Hard to learn
  • Hardware specific so not portable
  • Error prone
  • Difficult to write, debug and maintain with large programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the Opcode?

A

The binary representing the instruction

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

What is the Operand?

A

Represents location of data, varies by type of addressing

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

What are the different types of addressing memory?

A
  • Immediate
  • Direct
  • Indirect
  • Indexed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is immediate addressing?

A

When asked to load 1000 it will return 8

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

Direct

A

When asked to load 1000 it will return the value stored in the memory loacation 8.

17
Q

What is indirect addressing?

A

When asked to load 1000, it will find the value stored in the memory location 8 and then go to that memory location.

18
Q

What is indexed addressing?

A

Starts at the memory location stored in the operand and takes every contiguous item for the index register.

19
Q

What are the three sections of a class?

A
  • Name
  • Attributes
  • Methods
20
Q

How do you define a class in python?

A

class className()

21
Q

How do you define an encapsulation status?

A

private variableName

22
Q

How do you construct a class?

A

def __init__(self,v1,v2):
self.v1=v1
self.v2=v2
self.attribute= “something”

23
Q

How do you define a method in python?

A

def method(self):

24
Q

How to you make an object in python?

A

object1=className(v1,v2)

25
Q

How to call a method in python?

A

object1.method(v1)

26
Q

What is inheritance?

A

A mechanism in which you derive one class from another.

27
Q

How to create a child class in python?

A

class className(parClassName)

28
Q

What is Overriding?

A

Allows a child class to override a method provided by a parent class

29
Q

How do you override a method?

A

Create a new method with the same function name.

30
Q

What is polymorphism?

A

A pattern in which objects have a different functionality while sharing a common interface.

31
Q

What is encapsulation?

A

The process of making an attribute or method public or private.

32
Q

How are private attributes retrieved?

A

get and set methods