-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamprep1.cpp
54 lines (51 loc) · 2.62 KB
/
examprep1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* A way to classify the programming languuage based on their feature is called programming paradigm.
they are of two types imperative and declarative
1, imperative programming
such type of programming which focuses on how its done not only its desired output is called imperative
programming
eg : Procedural programming( c and C++ ) and object oriented programming ( c++ and java)
2. Declarative programming
Such type of programming which focuses on the desired output only not how its done is called declarative
programming
eg : Sql, html etc
*****
procedural programming
such type of programming language in which the problems are decomposed into smaller unit
of repeatable tasks (procedures) is called procedural programming language
Disadvantages of procedural programming
1. focuses on process
2. no information hiding
3. Difficult to manage large problems
4. Difficult to relate with real world objects
object oriented programming
such type of programming language which relies onn thhe concept of object and class are called object oriented
programming
a class is thus a similar number of objects
a instance of class is called object
Procedural programming vs object oriented programming language
procedural programming | object oriented programming
--Focuses on operation | -- focuses on object
-- focuses top - down approach | -- focuses buttom - up approach
principles of object oriented programming
1. encapsulation
2. inheritance
3. polymorphism
4. abstraction
1. encapsulation
Data encapsulation and data hiding are the major concepts of object oriented programmming
encapsulation refers to the bundling of the data and method that operate on that data within a single unit or
object this can help data to be ascessed , modified from outside the code or project
2. abstraction
abstraction is the process of exposing only the relevant data and methods to the user while hiding the implementation
detaails . This can help to simplify the interface and make the code easier to understand
3. inheritance
inheritance is the process by which one object can inhherit the properties and behaviour of another object
this can help to eliminate the redundancy in code and make it easier to reuse existing code
4 . polymorphism : Polymorphism is the ability of different objects to respond to the same method calls in different
ways. this can allow for more flexibilityy in the design of your code .
Benefits of object oriented programming
1. reusability
2. Robustness
3. extensibility
4. Easier to manage
*/