Week 1\Lec 1&2 Flashcards

1
Q

how is the problem with the procedure-oriented approach view?

A

, the problem is viewed as a sequence of tasks to be performed such as reading, calculating and printing

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

what is the program standing on in procedure-oriented approach?

A

the primary focus is on functions. As a number of functions are written to implement multiple tasks to solve problems

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

What do we mean by global data?

A

They are variables declared in such away they can be
accessed directly or indirectly (by reference) by all other functions.

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

What is the major limitations of procedural paradigm?

A

It is difficult to develop a large complex.

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

Why is Procedure‐Oriented Programming unsecure?

A

every function has complete access to the exposed variables, there is no protection on your data (a new programmer can corrupt the data accidentally when creating function).

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

Why is Procedure‐Oriented Programming not reusable?

A

Because procedural code needs to recreate the code if is needed to use in another application.

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

Why is procedural code hard to maintain ?

A

Because if new data is to be added, all the functions using that data need to be modified.

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

What is the fundamental idea behind object‐oriented languages ?

A

Is to combine into a single unit both data and the functions that operate on that data. and such unit is called object

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

What is oop?

A

It is a computer programming paradigm that organizes/ models software design around data or objects rather than functions and logic. It does not refer to a specific language but rather to a way to build a program or a methodology to apply.

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

How is the problem viewed in oop?

A

The problem is divided into the number of entities called objects and then builds data and functions around these objects. Communication of the objects done through function (called method).

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

Why is oop secure ?

A

Because the data is hidden and cannot be accessed by external functions. It ties the data more closely to the functions that operate on it, and protects it from accidental modification from the outside functions

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

Why is oop reusable?

A

Because the object is a self contained unit. Therefore, it can be easily incorporated into another program.

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

Why is oop easy to maintain?

A

Because each object is responsible of its data. When working with OOP languages, you know exactly where to look when something goes wrong

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

What are objects ?

A

An object is a software bundle of variables and related methods. It have state behavior.

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

what does objects contain from ?

A

Each object contains data, and code to manipulate the data

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

How does object interact?

A

When a program is executed, the objects interact by sending messages to one another

17
Q

What can software objects represent?

A

represent real-world objects, such as a bicycle
represent abstract concepts, such as a counter

18
Q

what is a class?

A

Software “blueprints” for objects

19
Q

Notes

A

Remember: a blueprint of a bicycle is not really a bicycle.
When you create an instance of a class, you create an object of that type.
The system allocates memory for the instance variables declared by the class.
You can then invoke the object’s instance methods to make it do something.
It’s possible also to remove the object from the memory.

20
Q

What is encapsulation?

A

Encapsulation is a process of hiding data members (variables, properties) and member functions (methods) into a single unit”.
And Class is the best example of encapsulation. It’s the first principle of oop!

21
Q

What is the point from encapsulation ?

A

1.Implementation details of an object can be changed at any time without affecting other parts of the program.
2.Through Encapsulation, Data is not accessible to the outside world, and only those functions which are wrapped in the class can access it.
3.Encapsulation solves the problem at the implementation level.
4. A class can specify how accessible each of its members (variables, properties, and methods) is to code outside of the class.

22
Q

What is absttraction?

A

it refers to the act of representing essential features without including the background details or explanations.

23
Q

What is data abstraction?

A

It is a programming(and design) technique that relies onthe separationofinterface andimplementation.

24
Q

What is inheritance?

A

Themechanismofderivinganew class fromanold classiscalledinheritance or derivation. Theinheritanceisthemostpowerful featuresofOOP.

25
Q

what are the names of new and old calsses

A

Theold classisknownasbase classwhile new classisknownasderived classorsub class.

26
Q

what does polymorphism mean?

A

It is a Greek term which means ability to take more than one form.

27
Q

what is polymorphism?

A

It is a program’s ability to treat objects with the same interface in the same way, without information about the object’s specific type. That mean that Different subclasses of the same superclass, can implement their shared interface in different ways

28
Q

What does binding mean ?

A

link betweenprocedure call andcode tobeexecute.

29
Q

What is dynamic binding?

A

Itistheprocess oflinkingofafunctioncall totheactualcodeofthefunctionatrun‐ time.
Thatis,indynamicbinding,theactualcode tobeexecutedisnotknowntothecompiler untilrun‐time.
Itisalsoknownlatebinding.

30
Q

what is message passing ?

A

Software objects interact and communicate with each other by sending messages to each other.

31
Q

notes

A

Objectscancommunicate witheachothersby passingmessagesameaspeoplepassingmessage witheachother.
Objectscansendorreceivemessageorinformation.
Conceptofmessagepassingmakesiteasiertotalk aboutbuildingsystemsthatdirectlymodelor simulatetheirreal‐worldcounterparts.

32
Q

Messagepassinginvolvesthefollowingbasicsteps what are they?

A

1.Creatingclassesthatdefineobjects&theirbehavior.
2.Creatingobjectsfromclassdefinitions.
3.Establishingcommunicationamongobjects.

33
Q

what are the benefits of oop?

A

User can create new data type or users define data type by making class.
Code can be extended by using inheritance.
Data can be hidden from outside world by using encapsulation.
Object oriented system can be easily upgraded from small system to large system.
It is easy to partition work for same project.
Message passing techniques make communication easier.
Software complexity can be easily managed.
Maintenances cost is less.
Simple to implement.