[Link] COMPUTER SCIENCE CLASSES ([Link].
:-8541851133,7004816953) C++ theory
C++ theory ! :- logical negation
Prepared by:- [Link] sir
Notes:-
[i] Arithmetic Operators :-
Subject :- Computer Science
+,-,*,/,%
[Link].:- 8541851133,7004816953 [ii] Shift operator :-
C++ theory >> Right shift
C++ :- C++ is an object Oriented Programming Language. It was << Left shift
developed by Bjarne Stroustrup in earlier 1980s in USA. [iii] Increment Or Decrement operators
Q. What is Token ? + + - -
Ans:- The smallest individual unit of a program is called [iv] Assignment operator:-
+ = , - = ,/ =, % = , * =
Token.
[v] Relational operators:-
Ex:- Cout , Void main , getch etc.
( = , < , >, <= , >=, != )
Cout :- Console Output [vi] Logical operators:-
( && , || ,! )
Header file of < iostream.h>
( Here:- && :- Logical AND, ||:- logical OR ,! :- NOT)
Cin Or Cout
[vii] Conditional operator:-
Header file of <conio.h> (? :)
clrscr (); getch(); Q. Write the difference between object oriented programming
Types of Token :- (OOP) and procedural programming ?
[i] Keywords
[ii] Identifiers OOP Procedural Programming
[iii] Literals (i)OOP works as Bottom-up (i)Procedural programming work as
[iv] Punctuators Approach. Top to down.
[v] Operators (ii) It does not support Class and
(ii) It support Class and Object.
[i] Keywords:- The keywords are reserve words that ++ Object.
(iii) It is used in C .
convey special meaning to the Language Compiler. (iii) It is used in C .
For eg:- int, float, char, void
[ii] Identifiers:- An Identifiers is the name given by user for
a unit of the program. It Indentify the given expression in Q. Difference between functions read( ) and write ( ).
C++. Ans:- The read ( ) lets one read a unit of information from a file
For eg:- sum , s,a,b etc and a write ( ) lets one write a unit of information to a file.
[iii] Literals:- Literals are data items that never change # Syntax Error :- A syntax error is that when statements are
wrongly written violating rules of the programming language.
their value during a program run.
For eg:- for(i=1:i<=10:i++);
There are four types of Literals:-
# Logical Error :- Logical error also known as design errors, occur
(i) integer Constant due to wrong formula.
(ii) character Constant For eg:- a+b/2 : answer not correctly
(iii) floating Constant (a+b)/2 : answer correctly.
(iv) string Constant # Run- time Error :- Run – time Error occur , when an operation
[iv] Punctuators:- The following characters are used as start in a program can’t be performed during program execution.
Punctuators. They are also known as separators. For eg:- x = x/0;
Data type :- Data type is a named group of data with similar
[ ] Bracket ( ) Parentheses characteristics and behavior.
{ } Braces , Comma For eg:- integer, character, real, Boolean etc.
(i) int integer 0 to 9
; Semi colon : colon (ii) char character A to Z & a to z
[v] Operators:- Operators are tokens that trigger some
(iii) float decimal 5.3, 3.2, _ _ _
action. Operator which applied to variables and other
(iv) double Large decimal 3.3333_ _ _ _
objects in an expression.
(v) Long int integer
Unary operator
& :- Address sign C++ theory
* :- multiplication sign
Prepared by:- [Link] sir
- :- Unary minus
+ :- Unary plus Subject :- Computer Science (Class-12th )
++ :- increment [Link].:- 8541851133,7004816953
- - :- decrement
[Link] COMPUTER SCIENCE CLASSES ,CHAS (BOKARO) Page 1
[Link] COMPUTER SCIENCE CLASSES ([Link].:-8541851133,7004816953) C++ theory
Basic Concept of oop- Q. what is a pointer ?
(i) Data abstraction Ans:- a pointer is a variable which holds the memory address of
(ii) Encapsulation another variable .We can access a variable by its name or its
(iii) Modularity address.
(iv) Inheritance Keywords (Reserve Words) :- int char float double float for if
(v) Polymorphism switch while do friend try catch .
what is data abstraction ? Data type :- Data type is a named group of data with similar
Ans :- data abstraction refers to the act of representing the essential characteristics and behavior.
features without including the background details or explain . For eg:- integer, character, real, Boolean etc.
Q. What is Array ?
Ex- in a switch board you only press certain switches according to your
requirement . What is happening inside, how it is happening we need Ans:- Array is a named list of finite number of similar data
not know, this is abstraction . elements.
What is encapsulation ? Q. What is Function ?
Ans :- Encapsulation is the wrapping of two data and functions into a Ans:- Function is a named part of program that can be invoked
single unit . from the other parts of other program.
Modularity – modularity is the property of a system that has been Q. What is one dimensional array ?
decomposed into a set of cohesive and loosely coupled members . Ans:- The simple array is called one dimensional array.
Inheritance – inheritance is the capability of one class of thing to inherit
capabilities or properties from another class . Q. What is 2D-array ?
Single inheritance – When one derived class inherits from one base Ans:- The collection of 1D- array is called 2D-array.
class , is called single inheritance . Q. What is Nested Loop ?
Multiple inheritance – When one derived class inherits from multiple Ans:- A Loop that contains another loop inside its body called
base classes , is called multiple inheritance. Nested Loop.
Multilevel inheritance – when a sub class acts as a base class for other Q. What is infinite Loop ?
class is known as multilevel inheritance . Ans:- A Loop that never end that is called infinite loop.
Base class- those class whose properties are inherited is called base What is expression ?
class or super class or parents class. Ans:- Valid combination of tokens is called expression.
Sub class – the class that inherits the properties is known as sub class Call by value :- In Call by value method, the called function
derived class or child class . creates its own copies of the original values sent to it.
Polymorphism – polymorphism is a very powerful concept that allows Call by reference :- In Call by reference method, the called
the designing of amazing flexible application . The word polymorphism function access and works with the original values using their
is derived from two greek words “poly” which means many and references.
“morphos” means forms. So, polymorphism means the ability to take Functional dependency :- Functional dependence is a relationship
many forms . that exists between any two fields.
i) Function overloading Passed by Value :- When an object is passed by value the called
ii) Operator overloading function creates its own copy of the object by just coping the
contents of the passed objects.
Function overloading – function overloading is the concept that Passed by reference :- When an object is passed by reference,
allows multiple functions to share the same name with different the called function does not creates its own copy of the passed
arguments . object.
Why an array is called a derived data type ? Data Independence :- Ability to modify a scheme definition in one
And array is called derived data type because it is derived by other level without affecting a scheme definition in the next higher
data type . level.
What is the similarity and difference between break and What is the difference between ‘a’ and “a” in C++ ?
continue statement ? Ans:- ‘a’ is a character constant and “a” is a string constant. The
Similarity :- both are jumping statement . size of ‘a’ is 1 character where as the size of “a” is 2 character.
Difference :- the break statement terminates the entire loop Object :- An Object is an identifiable entity with some
where continue statement terminates single pass of the loop . characteristic and behaviors.
Constructor – it is a member function having the same name as its Class :- A Class is a group of objects that share common
class and which is used to initialize the objects of that class type properties and relationships.
with a legal initial value . Data hiding :- Data hiding is property where by the internal data
Default constructor – A constructor that accepts no parameters is structure of on object is hidden from the rest of the program.
known as default constructor . Normalization :- Normalization is a process of data analysis used
Parameterized constructor – A constructor that receives for grouping data elements in a record.
parameters , is called parameterized constructor .
Copy constructor – A constructor that initializes an object using
the values of another object , is called Copy constructor .
Destructor – A destructor is a member function having same
name as that of its class preceded by ~ (tilde ) and which is used
to destroy the objects that have been created by a constructor .
[Link] COMPUTER SCIENCE CLASSES ,CHAS (BOKARO) Page 2