Answer to Question #283661 in C++ for Rasheed

Question #283661

Discuss Object oriented programming in c++ with 4 points. Each point shoult not be less


than 200 words.


Question 6 (40 marks) 200-50

1
Expert's answer
2021-12-30T02:33:02-0500

/* Object-oriented programming – As the name suggests uses objects in programming.

Object-oriented programming aims to implement real-world entities like inheritance,

hiding, polymorphism, etc in programming. The main aim of OOP is to bind together

the data and the functions that operate on them so that no other part of the code 

can access this data except that function.

Class: The building block of C++ that leads to Object-Oriented programming is a Class.

It is a user-defined data type, which holds its own data members and member functions,

which can be accessed and used by creating an instance of that class.

Object: An Object is an identifiable entity with some characteristics and behaviour.

An Object is an instance of a Class. When a class is defined, no memory is allocated

but when it is instantiated (i.e. an object is created) memory is allocated.

Encapsulation: In normal terms, Encapsulation is defined as wrapping up of data and

information under a single unit. In Object-Oriented Programming, Encapsulation is

defined as binding together the data and the functions that manipulate them.

Encapsulation also leads to data abstraction or hiding. As using encapsulation also

hides the data.

Abstraction: Data abstraction is one of the most essential and important features

of object-oriented programming in C++. Abstraction means displaying only essential

information and hiding the details. Data abstraction refers to providing only essential

information about the data to the outside world, hiding the background details or

implementation.

Polymorphism: The word polymorphism means having many forms. In simple words, we can

define polymorphism as the ability of a message to be displayed in more than one form.

Inheritance: The capability of a class to derive properties and characteristics from

another class is called Inheritance. Inheritance is one of the most important features

of Object-Oriented Programming.

Sub Class: The class that inherits properties from another class is called Sub class

or Derived Class.

Super Class:The class whose properties are inherited by sub class is called Base Class

or Super class.

Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to

create a new class and there is already a class that includes some of the code that we

want, we can derive our new class from the existing class. By doing this, we are reusing

the fields and methods of the existing class.

*/

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog