11 CS slow learners MATERIAL
11 CS slow learners MATERIAL
3MARKS
5. What is the radix of a number system. Give example
Radix means base , it is the count of number of numbers used in number system.
Number system Base
Binary (it uses 0 and 1 – 2numbers) 2
Decimal ( it uses 0 to 9 – 10 numbers) 10
Octal ( it uses 0 to 7 – 8 numbers) 8
Hexa Decimal (it uses 0 to 15 -16 16
numbers)
6. Write note on Binary number system.
Binary number system uses two bits i.e 0 and 1. It‘s
base is 2. Eg. (1010)2
5 MARKS
1.
2.
2MARKS
5 MARKS
5. How AND and OR can be realized using NAND and NOR gate.
3 MARKS
3. Describe the differences between keywords and identifiers?
Keywords Identifiers
Keywords are the reserved words which Identifiers are the user-defined names given to the
convey specific meaning to the C++ variables
compiler.
They are the elements to construct C++ These are the fundamental building blocks of a
programs. program.
Example: Switch, for, if, etc., Example: name, age, class, etc.,
4. Is C++ case sensitive? What is meant by the term “case sensitive”?
Yes, C++ is case sensitive as it treats upper and lower-case characters differently.
All the keywords must be in lowercase
5. What is the use of a header file?
#include<iostream> statement tells the compiler‘s to include the header file in the
program
To implement input/output functionalities.
―iostream‖contains the definition of its member objects cin and cout.
6. Why is main function special?
The main( ) function in the C++ program is the starting point.
All the programs begin their execution in main().
PAGE-10
5 MARKS
7. Write about Binary operators used in C++.
Binary Operators - Require two operands and one operator
C++ Binary Operators are classified as:
(1) Arithmetic Operators
(2) Relational Operators
(3) Logical Operators
(4) Assignment Operators
(5) Conditional Operator
1) Arithmetic operators
Operator Operation
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus (To find the
reminder of a division)
Relational operators
Operator Operation
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
== Equal to
!= Not equal
3) logical operators:
Operator Operation
&& AND
|| OR
! NOT
4) Assignment Operators:
Operator Name of Operator
+= Addition Assignment
-= Subtraction Assignment
*= Multiplication Assignment
/= Division Assignment
%= Modulus Assignment
5) Conditional Operator:
?: is a conditional Operator which is also known as Ternary Operator.
an alternate to if ..else statement
PAGE-11
Example Program:
#include<iostream>
using namespace std;
int main ()
{
for(int i = 0; i< 5; i ++ )
cout<< i;
return 0;
}
8. What is Recursion? Write a program to find the factorial of the given number using recursion. A
function that calls itself is known as recursive function.
3MARKS
1. Define an Array? What are the types?
An array is a collection of variables of the same type that are referenced by a common name.
Types Of Arrays :
One-dimensional arrays
Two-dimensional arrays
Multi-dimensional arrays
PAGE-14
11. Write a note on the basic concepts that supports OOPs? (OR)
Main Features of Object Oriented Programming
Encapsulation: Data and Functions are bound together into a single unit .
Data Abstraction: showing only the essential features without revealing background details.
Modularity : Modularity is designing a system that is divided into a set of functional units that can be
composed into a larger application.
Inheritance:The technique of building new classes (derived class) from an existing Class
(base class).
Polymorphism:The ability of a message or function to be displayed in more than one form.
2MARKS
1. Why it is considered as a good practice to define a constructor though compiler can
automatically generate a constructor?
The constructor is executed automatically when the object is created
It is a good practice to define a constructor, because it can be used explicitly to create new
object of its class type.
2. Differentiate structure and class though both are user defined data type.
The only difference is the members of structure are by default public where as it is
private in class.
3. Write down the importance of destructor.
A destructor function removes the memory of an object which was allocated by the
constructor at the time of creating a object.
4. What are advantages of declaring constructors and destructor under public accessibility?
We can initialize the object while declaring it.
We can explicitly call the constructor.
We can destroy the objects at the end of class scope automatically .
5 MARKS
5. Mention the differences between constructor and destructor
CONSTRUCTOR DESTRUCTOR
When a class object comes into scope,constructor When a class object goes out of scope, destructor
gets executed. gets executed.
The name of the constructor is same as class name. The name of the constructor is same as class name
prefixed with~
Constructor has no return type. Destructor has no return type.
can have parameter list. cannot have arguments.
They cannot be inherited They cannot be inherited
PAGE-16
CHAPTER – 15 POLYMORPHISM
2 MARKS
1. What is function overloading?
The ability of the function to process the message or data in more than one form is called
as function overloading.
2. List the operators that cannot be overloaded.
Scope operator (::) Sizeof
Member selector (.)
Member pointer selector (✳)
Ternary operator (?:)
3. What is the use of overloading function?
Reduces the number of comparisons and makes the program to execute faster.
4. What are the rules for function overloading?
The overloaded function must differ in the number of its arguments or data types
The return type of overloaded functions are not considered for overloading same data
type
5. What is operator overloading? Give some examples of operators which can be overloaded. The
term Operator overloading, refers to giving additional functionality to the normal C++
operators like +,++,-,—,+=,-=,*.<,>.
6. Discuss the benefits of constructor overloading.
A class can have more than one constructor with different signature.
Constructor overloading provides flexibility of creating multiple type of objects for a
class.
5 MARKS
7. What are the rules for operator overloading?
Precedence and Associativity of an operator cannot be changed.
No new operators can be created, only existing operators can be overloaded.
Cannot redefine the meaning of an operator‘s procedure. You cannot change how
integers are added. Only additional functions can be given to an operator
Overloaded operators cannot have default arguments.
When binary operators are overloaded, the left hand object must be an object of the
relevant class
CHAPTER-16 INHERITANCE
2 MARKS
1. What is inheritance?
The mechanism of deriving new class from an existing class is called inheritance.
2. What is a base class?
A class that is used as the basis for creating a new class is called a super class or base class.
3. Why derived class is called power packed class?
The derived class inherits all the properties of the base class.
It is a power packed class, as it can add additional attributes and methods and thus enhance
its functionality.
4. In what multilevel and multiple inheritance differ though both contains many base class?
Multilevel Inheritance:
In multilevel inheritance, the constructors will be executed in the order of inheritance.
Multiple Inheritance:
If there are multiple base classes, then it starts executing from the left most base class.
PAGE-17
3MARKS
1. What are the points to be noted while deriving a new class?
i) The keyword class has to be used
ii) The name of the derived class is to be given after the keyword class
iii) A single colon (:)
iv) The type of derivation (the visibility mode), namely private, public or protected.
v) The name of the base class (parent class), if more than one base class, then it can be given
separated by comma.
2. What is the difference between polymorphism and inheritance though are used for reusability
of code?
Polymorphism:
Reusability of code is implemented through functions (or) methods.
Polymorphism is the ability of a function to respond differently to different message.
Polymorphism is achieved through function and operator overloading.
Inheritance:
Reusability of code is implemented through classes.
Inheritance is the process of creating derived classes from the base class or classes.
Inheritance is achieved by various types of inheritances namely single, multiple,
multilevel, hybrid and hierarchical inheritances.
3. What do you mean by overriding?
When a derived class member function has the same name as that of its base class member
function , the derived class member function shadows/hides the base class‘s inherited function
This situation is called function overriding and this can be resolved by giving the base
class name followed by :: and the member function name.
5 MARKS
1. Explain the different types of inheritance
1. Single Inheritance: When a derived class inherits only from one base class
2. Multiple Inheritance:When a derived class inherits from multiple base classes
3. Hierarchical inheritance: When more than one derived classes are created from a single base
class
4. Multilevel Inheritance: When a class is derived from a class which is a derived class The
transitive nature of inheritance is reflected by this form of inheritance
5. Hybrid inheritance: When there is a combination of more than one type of inheritance
PAGE-18
PREVENTION:
To pretend being your friend and talk to you on Internet Relay Chat(IRC) or by Instant messenger, e-
mail can also be a source for them.
They may send official e-mail requesting some sensitive information.
3. Write the different types of cyber-attacks.
S.No. Cyber Function
Attack
1. Virus A small piece of computer code that can repeat itself from one computer to
another Eg: Trojan virus.
2. Worms Worms are self- repeating and do not require a computer Program to
attach themselves.
3. Spyware Installed automatically when clicking on links.
4. Ransomware Ransomware is a type of malicious program that demands payment after
launching.