Unit-1 Introduction to Object Programming in C++ | BCA 2nd Year
Unit-1 Introduction to Object Programming in C++ | BCA 2nd Year- Hello student welcome to the pencilchampions.com website this website provide BCA 2nd Year Object Oriented Programming (OOPS) unit 1Â
This website helpful all student. Thankyou for visiting pencilchampions.com
C++
- Object oriented features in C++ assist with extensibility to larger programs and make the software easier to maintain after selling it to the coster. It is helpful in properly formulating real-world problems.
- C++ is a middle-level programming language developed by Bjarne Stroustrup Stithing at Bell Labs in 1979. C++ works on different platforms like Windows, MAC OS and various versions of UNIX.
- Object Oriented Programming which includes four pillars of Object Oriented Development-
- Encapsulation
- Data inheritance
- Hide
- Polymorphism
Learning C++:-
- The most important thing while learning C++ is to focus on the concepts. The purpose of learning a programming language is to become more effective in designing and implementing new systems and maintaining old systems.
Read More External link –https://mrcet.com/downloads/digital_notes/HS/OOP_10122018.pdf
Read More-Â https://pencilchampions.com/unit-4-ms-window-cfoa-bca-first-year-2023/
Letters used in C++:-
- Alphabet
- Uppercase letters A to Z.
- Small letters from a to z.
- Numbers from O to 9
- Special characters
White space character. –
- A character that is used to generate spaces. When printed in C++ it is called white Space character. These are space tags, new lines and comments.
Keywords or reserved words:-
- Keywords are reserved words. C++ language uses the following keywords which are not available to the users to use as variable, function names. Whether the keywords are uppercase in the AP identifier.
Identifiers: –
- Â Identifier refers to the name given to entities such as variable, function, array etc. There are some rules for naming identifiers –
- The first character must be a character for underscore
- There should not be a name. A keyword.
- For example- code, code, core
- An unallocated identifier can contain both upper and lower case, numbers and letters. underscore.
- Some examples of invalid identifier names are-
Variable is a variable memory data.
- A name of a place.
Data Type:
- A data type specifies the type of data that a variable can store. Like – integer, floating, character etc. There are 4 types of data types C++ language.
Type data types
1 basic data types                                                                       Â
2: Derived Data Types
3 enumeration data types
4 user defined data type structure
- The basic data types are integer based and floating point based. The C++ language supports both signed and unsigned literals. The memory size of baric data types may vary depending on the 32 or 64 bit operating system.
Semi colon and block in C++:-
- It signals the end of a logical unit. For ex- the following are different statement
Comments in C++:-
- Program comments are explanatory statements that you can include in C++ code that you write and anyone can read its source code. All programming languages ​​allow some form of comments. C++ support single-line and multi-line comments. All characters are available inside any comment compiler. Ignored by C++
Variable Definition:-
A variable definition in which the programmer writes some instructions to tell the compiler to create a memory location data type variable name, syntax-storage in the variable-name.
Variable Initialization in C++:-
- In the above example variables are declared but no value is assigned to any of them. Variables can be initialized and initialized with their declaration. be entrusted with
Range of variables:-
- All variables have their value outside the region of their functioning and range, this range of variables.Â
we can Divide variables into two main types –
1- Global variables
2- Local variables
Abstraction:-
- Abstract classes are the way to achieve abstraction in C++. Abstraction in C++ is the process of hiding internal details by showing only functionality. Abstraction can occur in two ways:
- Get by abstract class
- Interface
- Both abstract class and interface can have abstract method which is necessary for abstraction. Data abstraction refers to providing only the necessary information to the outside world and hiding their background details to represent the necessary information in the program without presenting the details.
- Data abstraction is a programming (and design) technique that relies on the separation of interface and implementation. A real-life example of a TV that you can turn on and off, change channels, adjust volume, and add External components like speakers, AVD player but you don’t know its internal details.
Encapsulation:
- Encapsulation is the process of enclosing and objectifying the attributes and methods within a class.Â
Benefits of encapsulation:
- Data hiding – Abstraction of external access feature of a class.
- Information Trading – The implementation of the data is not known to the users.
Polymorphism in C++:-
- The word polymorphism means having many forms. We can term polymorphism as the ability to display a message in more forms.
Real-life example of polymorphism-
- An individual can have different characteristics at the same time.
- Compile time polymorphism (compile time binding, initial binding, static binding)
- Run Time Polymorphism (Run Time Binding, Late Binding, Dynamic Binding)
Compile time polymorphism :
- Â Overloading or operator overloading.
Function overloading
- Where there are multiple functions with the same name but different parameters, then this function is said to be overloaded.Â
Run time polymorphism
- Access on the other hand occurs when a derived class has a definition for one of the member functions of that base class.
Inheritance
- The ability of one class to acquire qualities and characteristics from another class is called inheritance. Inheritance is one of the most important features of object oriented programming.
Super class (base class or parent class)
- The class whose properties are inherited by the subclass is called base class or super class.
Subclass (child class or derived class)
- The class which inherits properties from another class is called subclass or derived class. Or
Types of inheritance –
There are five types of inheritance.
- 1 single inheritance
- Multiple inheritance
- Multi-level inheritance.
- Hierarchical inheritance..
- 5 Hybrid inheritance
Discover more from Pencil Champions
Subscribe to get the latest posts sent to your email.