Section 3 - Software development Flashcards

(9 cards)

1
Q

Chapter 13 - Programming Paradigms

List the 3 main programming paradigms

A

1. Procedural (Imperative)
2. Object-Oriented
3. Declarative (includes functional and logic styles – awareness level)

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

Chapter 13 - Programming Paradigms

What are some key characteristics of the Procedural Paradigm

A

Key characteristics:
- Program follows sequence -> selection -> iteration
- Uses procedures and functions
- Data stored in variables that change
- Top-down design (break problem into smaller steps)
- Easy to trace because control flow is visible
- Ideal for mathematical or algorithmic problems

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

Chapter 13 - Programming Paradigms

What are some benefits and drawbacks of using the Procedural Paradigm

A

Advantages:
- Simple to write and understand
- Efficient and fast
- Works well for algorithms
- Each subroutine can be tested on its own

Disadvantages:
- Not suitable for large sysems with many interacting parts
- No built-in way to protect data (no encapsualtion)
- Data and operations are separate, cause duplication
- Harder to maintain as system grows

Suitables for:
- Problems with a clear sequence of actions
- Programs where data noes not need complex structure
- Situations where speed and low overhead matter

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

Chapter 13 - Programming Paradigms

What are some real examples of procedural tasks

A
  • Sorting algorithms
  • Searching algorithms
  • File processing
  • Data validation routines
  • Converting units
  • Payroll systems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Chapter 13 - Programming Paradigms

What are some key characteristics of the Object-Oriented Paradigm

A

Key characteristics:
- Classes define attributes and methods
- Objects represent real-world things
- Encapsulations protects internal data
- Inheritance shares common behaviour
- Polymorphism allows flexible method behaviour
- Ideal for large systems with many related entities

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

Chapter 13 - Programming Paradigms

What are some benefits and drawbacks of using the Object-Oriened Paradigm

A

Advantages:
- Encapsulation protects data
- Inheritance reduces repeated code
- Polymorphism gives flexibility
- Easier to maintain and scale
- Mirrors real-world systems

Disadvantages:
- More complex to learn
- More memory overhead
- Not ideal for simple algorithms
- Overuse of classes can overcomplicate solutions

Suitables for:
- Long-term, complex projects
- Systems where many entities interact
- Projects requiring maintainability and extension
- Scenarios where data protection is needed

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

Chapter 13 - Programming Paradigms

What are some real OOP examples

A
  • Banking system -> Account, SavingsAccount, Transaction
  • Game -> Player, Enemy, Item, Weapon
  • GUI -> Window, Button, TextBox
  • Shop -> Customer, Order, Product, Payment
  • School system -> Student, Teacher, Course
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Chapter 13 - Programming Paradigms

What are some key characteristics of the Declarative Paradigm

A

Two sub-types:
- Functional – Programs are built from pure functions without side effects
- Logic – Program consist of facts and rules, and the system works out answers

Functional: Key characteristics:
- No changing state
- No loops (recursion is used instead)
- Functions take inputs and produce outputs
- Easy to test because results depend only on inputs

Logic: Key characteristics:
- You state logical relationships
- The interpreter performs inference
- No explicit control flow

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

Chapter 14 - Assembly Language

Explain the 4 different addressing modes

A

1. Immediate addressing - the operand is the actual value to be operated on

2. Direct addressing - the operand holds the memory address of the value to be operated on. This is the only addressing mode used in the LMC assembly language

3. Indirect addressing - the operand is the location which holds the address of the data we want. This enables a larger range of addressable locations

4. Indexed addressing - the address of the operand is obtained by adding the contents of the index register a constant value ( usually 1 ). The number of the index register and the constant value are included in the instruction code.

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