Lesson 4: Differences between procedural and object-oriented language Flashcards

(30 cards)

1
Q

can you name 3 languages used in procedural programming ?

A

Fortran, ALGOL, COBOL, BASIC, Pascal and C

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

what does IDE stand for ?

A

integrated development environments

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

PP: In procedural programming, program is divided into small parts called ……. ?

A

functions.

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

OOP: In object-oriented programming, program is divided into small parts called …… ?

A

objects.

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

PP: Procedural programming follows a ……

A

top down approach.

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

OOP: Object oriented programming follows …..

A

bottom up approach.

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

PP: TRUE OR FALSE: Adding new data and functions is easy ?

A

FALSE (Not easy)

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

What is procedural programming?

A

A programming approach where a program is broken into step-by-step procedures or functions.

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

What does “top-down approach” mean?

A

Starting with the whole problem and breaking it down into smaller procedures.

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

What is a procedure (or function)?

A

A set of instructions that performs a specific task in a program.

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

Can procedures call other procedures?

A

yes, procedures can call other procedures during program execution.

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

Why are programs broken into smaller procedures?

A

To make the program easier to understand, manage, and debug.

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

What tool do programmers use to write and manage procedural code?

A

An Integrated Development Environment (IDE).

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

What does each procedure mainly contain?

A

A series of computational steps or instructions.

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

What is object-oriented programming (OOP)?

A

A programming approach that uses classes and objects to build reusable code.

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

What does “bottom-up approach” mean in OOP?

A

Starting with small classes and building the full program from them.

17
Q

What is a class?

A

A blueprint that defines attributes and methods for objects.

18
Q

What is an object?

A

A specific instance of a class with actual values for its attributes.

19
Q

What is the difference between a class and an object?

A

A class is a blueprint; an object is a real example made from that blueprint.

20
Q

What are attributes?

A

Variables that describe an object, such as colour or wheels.

21
Q

What are methods?

A

Functions inside a class that perform actions for objects of that class.

22
Q

Why doesn’t changing one object affect others?

A

Because each object has its own values separate from the class and other objects.

23
Q

Give two examples of object-oriented programming languages.

A

Python and Java

24
Q

COM: How is a program divided?

A

Procedural: into functions

OOP: into objects

25
What approach does each use?
Procedural: top-down OOP: bottom-up
25
Which is easier to extend?
Procedural: harder to add data/functions OOP: easier to add data/functions
26
How is data protected?
Procedural: little or no data hiding OOP: data hiding improves security
27
What is the main focus?
Procedural: functions OOP: data and objects
28
Which models real life better?
Procedural: less realistic OOP: based on real-world objects
29
Give language examples.
Procedural: C, Fortran, Pascal, BASIC OOP: C++, Java, Python, C#