Skip to main content

Free notes of C++ language theory ,12 th HSC (part 1)

 What is c++ ? What is the advantages of c++ ?


C++ is an object oriented programming language Initially c++ was name as “c with classes”. C++ was developed by Bjarne stroustrup at & T Bell Laboratories , usa , in the early eighties . Advantages of c++ over c are :


(1) c++ is an incremented version of of c . It is sperset of c. almost all c programme are also run in c++ compiler .


(2) The important faculties added in c++ are classes , function overloading , operator overloading .


(3) C++ allow user to create abstract data type , to inherit properties from existing data type .


(4) c++ supports polymorphism .


(5) Any real life application systems such as editor , compiler , database , communication system can be built by c++.


(6) Object oriented libraries can be built by c++.


(7) c++ programs can be easily implemented , maintained and expanded.


What do you mean by object based programming language and object oriented programming language? State the relationship between these language .


 Object based programming language:


(1) language that supports programming with object are said to be object based programming language .


(2) it is a style of programming that primarily supports encapsulation & object or identity.


(3) Major feature are :


(a) Data encapsulation

(b) Data hiding & access mechanism.

(c) Automatic initalization & clean-up objects

(d) operator overloading .

(4) They do not support inheritance & dynamic binding .


Object- oriented programming language:

(1) This language incorporates all the object based feature along with inheritance and dynamic binding .

(2) For eg. – c++, smalltalk.

The relation between them characterized by followings statement :

Object oriented programming =. Object based feature + inheritance + dynamic binding .


Advantages of object oriented programming : (1) through , inheritance , eliminate redundant code and extend the use of existing classes. (2) The principle of data hiding helps the programmer to build secure program. (3) It is possible . To have multiple instances of an object to co exist without any interference . (4) It is easy to partition the work in a ; project based on object .


Advantages of object oriented programming :

(1) through , inheritance , eliminate redundant code and extend the use of existing classes.

(2) The principle of data hiding helps the programmer to build secure program.

(3) It is possible . To have multiple instances of an object to co exist without any interference .

(4) It is easy to partition the work in a ; project based on object

(5) Oop system can be easily upgraded from small to large system .

(6) Software complexity can be easily manage .

(7) It is possible to map object in the problem domains to object in the program .

(8) Good message passing technique for communication between object.

(6) Software complexity can be easily manage .

(7) It is possible to map object in the problem domains to object in the program .

(8) Good message passing technique for communication between object.

Data types

• C++ allows user to create new abstract data types , which can behave like any built in data types.

• These are called user-define data types. These includes structure ,union, class , enumeration.

• C++ provides three built-in data types which are integral , void, floating .

• Integral includes integer and character while floating type include float and double

• In addition to these data types C++ provide user with array , function , and pointer which are called as derived data types.

Enlist the basic data types used in c++ with size of data in term of bytes for each .

There are three main basic built – in data types used in c++ viz. integral type , void and floating type.


 Integral data type :

It include integer (int) and characters (char) .

An int variable requires 2 bytes to store , while a character variable requires 1 byte.

Integer variables are also of two types :

(a) short int (b) long int.

long integer requires 4 bytes , while short integers requires 2 bytes .


Void data type :

 Void data type is used :

(a) to specify the return type of a function when it is not returning any value .

(b) to indicate an empty argument list to a function .

(c) to declare generic pointers .

Floating type :

 Floating type variables are of two types ; float and double.

A float variables requires 4 bytes , while double requires 8 bytes to store in memory .

 There is another kind of double namely long double , which requires 10 bytes to store in memory .

Write a short note on scope resolution operator ? (oct. 2014 ; mar. 2016 )

(1) The operator :: is called as scope resolution operator .

(2) C++ is a block structure language i.e a c++ program may contain one block within another block .

(3) When a variables is declared in program , scope extends from the point of declaration till the end of the block in which it is defined .

(4) The same variables name can be used to have different.

Comments

Popular posts from this blog

partitioning (operatimg system ).

 WHAT IS PARTITIONING ? Certain operating system use partitioned memory management to allow multiprogramming . • Partitioning means dividing main memory into various sections.  • These section are called as partitions.  • There are two types of partitions: 1) fixed partition .    2) variable partition.   Fixed partition  .  • In this method partitions are fixed at the time of system generation . At this time , system manager has to declear partition time.  • Fixed partition are also called static partition . On declearing fixed partition , the operating system create partition description table.  • It reduces the uses the CPU utiliisation .  • It reduces the degree of multiprogramming. .    variable partition .     In variable partition number of partition and their size are variable  • They are not defined at the time of system generation .  • These partition are created by operating systems...

12th HSC free notes of c++ language theory part 3

  Object oriented programming • Object oriented programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and function that can be used as templates for creating copies of such modules on demand . • In object oriented programming the program is designed around the data being operated upon rather than upon the operation themselves. • OOP allows to decompose a problem into a number of entities called object and then build data and function around these entity. • When program is executed the object interact by sending message to one another • Each object contains data and code to manipulate the data . Features of OOP : • Program are divided into number of object. • Data is hidden and cannot be accessed by external function • Object may communicate with each other through function • New data and function can be easily added wherever required. Object : • Object are the basic runtime entity in object oriented sy...

Free notes of the operating system some imp questions

 1. ALU  2. STACK POINTER 3. PROGRAM COUNTER 4. INSTRUCTION REGISTER AND DECODER ALU ( ARITHMATIC AND LOGIC UNIT ) It is 8 bit unit  In this arithmetic and logical operation are carried out . ALU contain the binary adder to perform addition substracion by 2’s complement method Data is supplied by memory devices and input ouput devices The result is typically stored in the accumulator. STACK POINTER:- Stack poiointer is a 16 bit register which contain the address of top of stack With the help of incrementer and decrementer stack pointer perform their work The stack pointer is incremented when data is push  The stack pointer is decrementd when data is pop. INSTRUCTION REGISTER AND DECODER :- During the instruction fetch, the first 8 bit of instruction is transfer to the 8 bit instruction register The content of instruction register are available to the instruction decoder The output of decoder get by timing signals, ALU & data buffer. PROGRAM COUNTER:- Program coun...