0% found this document useful (0 votes)
2 views

II PUC passing package updated on march 2024

The document provides a comprehensive overview of computer system components, focusing on the motherboard, its characteristics, and various types of buses, ports, and slots. It also explains logic gates, their functions, and the principles of Boolean algebra, including laws and theorems. Additionally, it discusses cache memory, power supplies, and types of motherboards, along with practical applications of logic gates.

Uploaded by

Bharath Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

II PUC passing package updated on march 2024

The document provides a comprehensive overview of computer system components, focusing on the motherboard, its characteristics, and various types of buses, ports, and slots. It also explains logic gates, their functions, and the principles of Boolean algebra, including laws and theorems. Additionally, it discusses cache memory, power supplies, and types of motherboards, along with practical applications of logic gates.

Uploaded by

Bharath Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 43

1.

Typical Configuration of Computer System


1. Explain characteristics of motherboard.
 Form factor: it gives the specifications of motherboard such as dimensions, Geometry etc
 Chipset: it is the collection of microchips and it co-ordinates with the data transfer between the components
of computer
 Processor socket: it is a socket on the motherboard where the processor is connected
2. Explain any five components of motherboard.
a. Bus: Bus is a set of wires which are used to carry the data and signals from one component to another
within the computer
There are two types
 Internal Bus: Data bus, Address bus and Control bus
 External Bus
b. Processor slot: it is used to connect the processor chip to the motherboard
c. CMOS: Complementary Metal Oxide Semiconductor. It supplies power to the ROM chip to maintain system
time, date and configuration
d. I/O ports: Port is a socket on back of the computer used to connect external devices to the computer
Types:
1) Serial Port:
 In this port the data is transmitted bit by bit at a time
2) Parallel Port:
 In this port group of bits of data (8 bits) is transmitted at a time
e. BIOS (Basic Input Output System):
 It is a small chip on the motherboard that holds a set of instructions to load the hardware settings
required to activate various devices.
 The BIOS runs when the computer is switched on.
 BIOS invokes the bootstrap loader to load the operating system into memory
3. Explain the types of Bus.
Buses are mainly divided into two types
 Internal Bus (System bus): it connects major computer components like processor, memory etc
 External bus(Expansion bus): it connects different external devices
Internal bus and external bus are three kinds of buses
 Data bus: it transfer the data from CPU to memory and memory to CPU
 Address bus: it connects CPU and RAM with a set of lines of wire similar to data bus
 Control bus: It is used to control the access to and the use of the data
4. What are slots (expansion slots)? Explain any five slots.
Slots are used for adding an extra functionality to the computer by inserting a Printed Circuit Board
Types:
 ISA(Industry Standard Architecture): it is used to connect Modem and Input devices
 PCI slots (Peripheral Component Interconnect): it is used to connect Graphics card
 AGP slots(Accelerated Graphics Port): it is used to insert Graphics card
 RAM slot: it is used to install RAM memory to motherboard
 Processor slot: it is used to insert processor chip to motherboard

5. What is port? Explain any five types of port.


Port is a socket on back of the computer used to connect external devices to the computer

1
Types:
1) Serial Port:
 In this port the data is transmitted bit by bit at a time
 It is also called Communication port
 It is used to connect Mouse, Modem and old printers
2) Parallel Port:
 In this port group of bits of data (8 bits) is transmitted at a time
 It is used to connect Printers and some type external storage devices
3) USB port:
 It is a Plug and Play device which transfers 12MB of data per second, which is used to connect
audio player, Keyboard, Pendrive etc
 It is a Single, Standardized, easy to use way to connect a variety of I/O devices to a computer
4) Game port: it is used to connect joystick to the computer
5) Ethernet port: It connects network and high speed internet
6. Explain Cache memory in detail
It is a small and high speed memory placed between the CPU and RAM and it increases the speed of CPU by
supplying data faster than RAM
 The data transfer between the CPU and RAM is a time consuming process because CPU works
faster than RAM. Therefore to increase the speed of data supply the cache memory is introduced.

There are three types of Cache memory:


1) L1 cache:
 it is placed within a processor
 it is faster than L2 and L3 cache memory
 its capacity is 512 KB
2) L2 cache:
 it is placed within the motherboard between CPU and RAM
 its memory capacity is 6MB
3) L3 cache:
 it is placed within the motherboard of latest computers
 its memory capacity is 12MB
7. What is SMPS?
 SMPS-Switch Mode Power Supply
 It converts 230v AC to 5 to 12 DC current, which is used to supply the power to different
components of computer
8. What is UPS? Explain its types.
 UPS- Un-Interruptible Power Supply
 It is used to supply power from its battery at the time of Power outage
Two types:

2
a) Standby Power Supply(SPS) or Offline UPS:
In this UPS, if there is any problem in the main power supply then it switch over to the battery
and supply the power. It requires several milliseconds to supply the power, this results the system
may restarts in certain cases
b) Online UPS:
It supplies the power directly from its own inverter. If there is any problem in main power system,
then the inverter supplies the power from battery. Hence there is no break in power supply.
9. Explain the types of Motherboard.
 XT Motherboard ( eXtended Technology)
 AT Motherboard ( Advanced Technology)
 Baby AT Motherboard
 ATX Motherboard ( Advanced Technology eXtended)
XT Motherboard:
 It is old type of motherboard
 It contains DIMM RAM slots, ISA slots, 12 pin power connector
AT Motherboard:
 contains PGA socket, SDRAM slots, PCI slots
 20 pin power connector
Baby AT Motherboard:
 contains MPGA Processor socket, DDRDRAM slots
 it contains PCI slots, AGP slots
 20 pin and 24 pin power connector
ATX Motherboard:
 Latest motherboards all are called as ATX motherboards, designed by ATX form factor
 It contains MPGA processor sockets, DDRRAM slots, PCI slots, AGP slots,
 It contains 20 pin and 24 pin power connector and ports.
 Example: Pentium-IV, Dual Core, Core 2 Duo, Quad Core, i3, i5 and i7 processors.

2. Logic Gates
1. What is logic gate?
Logic gate is an electronic circuit design with one or more inputs and only one output, which is used to
perform logical operations.
2. Name the basic Logic gates.
AND gate
OR gate
NOT gate
3. Name the Combinational gates.
NAND gate
NOR gate
XOR gate
XNOR gate
4. What is Universal Gate?
Universal gate is a gate by which we can realize all three basic gates by using single type of gate
5. Name the Universal gates.
NAND gate
3
NOR gate
6. What is another name of NOT gate?
Inverter
7. Write circuit symbol and truth table for NOT gate.
A A

0 1

1 0

8. Explain the working of AND gate


OR
Write Standard (Logic Circuit diagram) and Truth table for AND gate.

 In AND gate the output is 1 only when all inputs are 1 and in remaining all cases the output will be 0

2 inputs A B A.B
0 0 0
0 1 0
1 0 0
1 1 1

3 inputs
A B C A.B.C
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

9. Explain the working of OR gate


OR
Write Standard (Logic Circuit diagram) and Truth table for OR gate.

 In OR gate the output is 0 only when all inputs are 0 and in remaining all cases the output will be 1

2 inputs
A B A+B
0 0 0
0 1 1
4
1 0 1
1 1 1
3 inputs A B C A+B+C
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

10. Explain the working of NAND gate


OR

Write Standard (Logic Circuit diagram) and Truth table for NAND gate.

 In NAND gate the output is 0 only when all inputs are 1 and in remaining all cases the output will be 1
2 inputs

A B A.B A.B
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0

A B C A.B.C A.B.C
0 0 0 0 1
3 inputs
0 0 1 0 1
0 1 0 0 1
0 1 1 0 1
1 0 0 0 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 0
11. Explain the working of NOR gate
or

5
Write Standard (Logic Circuit diagram) and Truth table for NOR gate.
 In NOR gate the output is 1 only when all inputs are 0 and in remaining all cases the output will be 0
2 inputs
A B A+B A+ B
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0

A B C A+B+C A+ B+C
3 inputs
0 0 0 0 1
0 0 1 1 0
0 1 0 1 0
0 1 1 1 0
1 0 0 1 0
1 0 1 1 0
1 1 0 1 0
1 1 1 1 0

12. Write Standard (Logic Circuit diagram) and Truth table for XOR gate.
2 inputs

A B A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
3 inputs

A B C A⊕B⊕C
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
13. Write Standard (Logic Circuit diagram) and Truth table for
XNOR gate. A B A⊙B
2 inputs 0 0 1
60 1 0
1 0 0
1 1 1
3 inputs A B C A⊙B⊙C
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0

14. Realise AND, OR, NOT gates using NAND gates.


OR
Write circuit for AND, OR, NOT gates using only NAND gates
OR
Prove NAND gate is an universal gate

15. Realise AND, OR, NOT gates using NOR gates.

7
OR
Write circuit for AND, OR, NOT gates using only NOR gates
OR
Prove NOR is gate an Universal gate

3. BOOLEAN ALGEBRA

1. Boolean Postulates:
 If x≠0 then x=1 where x is Boolean variable
 If x≠1 then x=0 where x is Boolean variable
 AND Relations
0.0=0
0.1=0
1.0=0
1.1=1
 OR Relations
0+0=0
0+1=1
1+0=1
1+1=1
 Not Operations
0=1

1=0

2. Boolean theorems.
0.X=0
1.X=X
0+X=X
1+X=1

Indempotence Law:
8
X.X=X
X+X=X
Complementarity Law:
X. X =0
X+ X =1
Involution law:
X́ =X
Practice above theorems in perfect induction method and truth table

3. State and Prove Commutative Law


6) A+B=B+A
7) A.B=B.A

A B LHS RHS A B LKS RHS


A+B B+A A.B B.A
0 0 0 0 0 0 0 0
0 1 1 1 0 1 0 0
1 0 1 1 1 0 0 0
1 1 1 1 1 1 1 1

4. State and Prove Associative Law


a) A.(B.C)=(A.B).C b) A+(B+C)=(A+B)+C
Proof:

A B C B.C LHS (A.B) RHS A B C B+C LHS (A+B) RHS


A.(B.C) (A.B).C A+ (A+B)+C
0 0 0 0 0 0 0 (B+C)
0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 1 1 1 0 1
0 1 1 1 0 0 0 0 1 0 1 1 1 1
1 0 0 0 0 0 0 0 1 1 1 1 1 1
1 0 1 0 0 0 0 1 0 0 0 1 1 1
1 1 0 0 0 1 0 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1

9
5. Prove X+XY = X
LHS=X+XY

∵ 1+Y =1
=X (1+Y)
=X (1)
=X
6. Prove X(1+Y) =X
LHS= X (1+Y)
=XX + XY
=X + XY
=X (1+Y)
=X.1
=X
=RHS
7. Prove X + X Y = X+Y
LHS = X + X Y
= (X+ X ) (X+Y) use distributive law
= (1) (X+Y)
= (X+Y)
=RHS
8. Prove (X+Y) (X+Y ) = X
LHS = (X+Y) (X+Y )
= XX + XY +XY + YY
=X + X (Y +Y) + 0
=X + X (1)
=X + X
=X
=RHS
9. Prove X ( X +Y) = XY
LHS = X ( X +Y)
=X X +XY
=0 +XY
=XY
=RHS
10. Prove XY+XY = X
LHS = XY+XY
= X (Y +Y )
= X (1)
= X= RHS
11. Prove (X+Y) (X+Z) = X +YZ
LHS =(X+Y) (X+Z)
=XX + XZ + XY + YZ
=X + XZ + XY + YZ
=X (1 + Z + Y) + YZ
=X (1) + YZ
=X + YZ =RHS

10
12. State and Prove DeMorgan’s Theorem
Statement1: when AND Product of two Boolean variables is complemented then we get OR sum two
complemented variables
i.e X . Y = X + Y
Proof:

X Y X.Y LHS X Y RHS


X .Y X +Y
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0

Statement2: when OR Sum of two Boolean variables is complemented then we get AND product two
complemented variables
i.e X +Y = X . Y
Proof:

X Y X+Y LHS X Y RHS


X +Y X .Y
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0

13. Write the Principle of duality theorem. Write an example


 Changing each 0 to 1 and 1 to 0
 Changing each AND(.) to OR(+) and OR(+) to AND (.)
Ex: 1+X =1
Its dual form is 0.X =0
14. What are minterms and maxterms?
Minterm: it is product of all variables (literals) with or without complemented in logical system
Maxterm: it is Sum of all variables (literals) with or without complemented in logical system
15. What is tautology? Give an example.
If the output of the given Boolean expression is always 1 (True) then that expression is called tautology
Ex: 1+X=1
16. What is Fallacy? Give an example.
If the output of the given Boolean expression is always 0 (False) then that expression is called Fallacy
Ex: 0.X=0
17. K MAP
Practice 4-variable SOP K-MAP problems from notes

11
4. DATA STUCTURES
1. What is data structure?
It is a specialized format for organizing and storing data
2. Types of data structure
 Primitive Data structure
 Non-Primitive Data structure
3. Primitive Data structure: these are readily available in the programming language and directly operated upon
by machine level instructions
Ex: int, float, char, double
4. Non-Primitive Data structure: these are not readily available they are derived from the Primitive Data
structure
Ex: Array, Stack, Queue, Linked list, Tree, Graph
5. Types of Non-Primitive Data structure
 Linear Data structure
 Non-Linear Data structure
6. Linear Data structure:

In this data structure there is a linear relationship between the data elements. i.e if we know the address of one
element then we can easily find its next and previous element

7. Non-Linear Data structure:


It is a data structure in which a data item is connected to several other data items
8. Explain the operations on Arrays or Operations on Linear Data structure
 Traversing: it is the process of accessing each and every element of the array (data Data structure) to
perform some operations
 Searching: it is the process of finding location of an element in the array
 Sorting: it is the process of arranging the elements in Ascending order or in descending order
 Insertion: it is the process of adding new element into array
 Deletion: it is the process of removing an existing element from array
 Merging: it is the process of combining two or more data structures into one data structure
9. What is an array? Explain its types.
Array is a collection of homogenous elements Or
Array is a collection of similar type of data elements with the same
Types:
 One dimensional array(1-D): elements are accessed using single index value
 Two dimensional array(2-D): elements are accessed using two index value
 Multi dimensional array:
10. Explain the operations on Primitive data structure.
 Create: it creates a new data structure
ex: int x;
 Select: it is used to access data
 Update: it is used to change the data of data structure
 Destroy: it is used to remove or destroy data from data structure

12
11. Algorithm for Traversing
Step1: start
Step2: input n
Step3: for (i=0 to n-1)
Step4: read a[i]
[End for i]
Step5: for (i=0 to n-1)
Step6: output a[i]
[End for i]
Step7: stop
12. Algorithm to find location using Linear Search
Step1: loc=-1
Step2: for (i=0 to n-1)
Step3: if (ele==a[i]) then
Step4: loc=i
Step5: goto step 6
[End if]
[End for i]
Step6: if (loc>=0) then
Step7: print loc
else
Step8: print “element is not found”
[End if]
Step7: stop

13. Algorithm to find location using Binary Search


Step1: initialize B=LB, E=UB, loc=-1
Step2: while (B<=E)
Step3: M=int (B+E)/2
Step4: if(ele==a[M])then
Step5: loc=M
Step6: goto step 10
else
step7: if(ele<a[M])then
step8: E =M-1
else
Step9: B=M+1
[End if]
[End while]
Step10: if(loc>=0) then
Step11: print loc
else
Step12:print “ element is not found”
[end if]
13
Step13: stop

14. Algorithm to insert an element into array (insertion)


step1: for (i=n-1 down to p)
step2: a [i+1] = a[i]
[End for i]
step3: a[pos] =item
sep4: n=n+1
step5: exit
15. Algorithm to delete an element from array (deletion)
step1: item =a[pos]
step2: for(i=pos to n-1)
step3: a[i] =a[i+1]
[end for i]
sep4: n=n-1
step5: exit
16. Algorithm to arrange(sort) the elements using insertion sort
1) for(i=1 to n-1)
2) j=i
3) while(j>=1)
4) if(a[j]<a[j-1]) then
5) temp=a[j]
6) a[j]=a[j-1]
7) a[j-1]=temp
[end if]
8) j=j-1
[end while]
[End for i]
9) exit
17. Algorithm to perform PUSH operation on stack
1) if (top==n-1) then
2) print “satck is full”
3) exit
[end if]
4) top=top+1
5) a[top]=item
6) return

18. Algorithm to perform POP operation on stack


1) if (top==NULL) then
2) print “satck is empty”
3) exit
[end if]
4) item=a[top]
5) top=top-1

14
6) return
19. Algorithm to insert an item at rear end of Queue
1) if(rear==n-1) then
2) print “Queue is full”
3) exit
[end if]
4) if(front==NULL) then
5) front=0
6) rear=0
else
7) rear=rear+1
8) [end if]
9) a[rear]=item
10) return
20. Algorithm to delete an item at front end of Queue
1) if(front==NULL) then
2) print “Queue is empty”
3) exit
[End if]
4) item=a[front]
5) if(front==rear) then
6) front=NULL
7) rear=NULL
else
8) front=front+1
[end if]
9) Return

21. What is stack?

It is a collection of items in an order where the elements are inserted and deleted at the same end top

22. Explain operations performed on stack


 stack(): it creates an empty stack
 push(item): it adds an item at the top of stack
 pop(): it deletes top element from the stack
 size(): it gives number of elements of stack
 isempty(): it checks whether the stack is empty or not
 isfull(): it checks whether the stack is full or not

23. Applications of stack.


 It is used to reverse a string
 It is used to perform recursion operation
 It is used to convert infix expression to postfix expression
 It is used to evaluate the expressions
 It is used to implement Tower of Hanoi
15
 It is used to perform Undo operation
24. What is Queue?

Ans: it is a collection of items in an order where the items are inserted at rear end and deleted at the front end

25. Applications of Queue.


 It is used to implement Simulation
 It is used in Printer server applications
 It is used in multi-programming platform systems
 It is used to implement Round Robin algorithm
 It is used to implement Scheduling algorithms
26. Types of Queue
a) Simple queue: in this queue the elements are inserting at rear end and deleting from front end

b) Circular Queue: in this queue all nodes are treated as circular and last element follows first element

c) Double Ended Queue: In this queue insertion and deletion can be done in both sides

d) Priority Queue: In this queue an element can be inserted and removed from any position based on their
priority

27. Explain operations on Queue


 queue(): it creates an empty queue
 enqueue(item): it inserts an item at the rear end of queue
 dequeue(): it deletes an item from the front end of queue
 isempty(): it checks whether the queue is empty or not
 isfull(): it checks whether the queue is full or not
16
 size(): it gives total number of items of queue

5. Introduction to OOP
1. What is Object Oriented Programming (OOP)?
It is the Principle of design and development of programs using modular approach
Ex: C++, Java, Mat Lab, C#
2. Advantages of OOP (Object Oriented Programming)
 The programmes are modularized based on the principle of classes and objects
 Data is encapsulated along with functions. Therefore external function cannot access the data
 Easy to develop a complex software
 The concept of data abstraction separates the object specification and object implementation
 Creation and implementation of OOP code is easy and reduces software development time
 OOP code can communicate through message passing

3. Applications of OOPs
 Used to develop Computer Graphics Applications
 Used to design CAD/CAM software
 Used to design Object Oriented data base
 Used to design Real time systems
 Used to implement Simulation and Modelling
 Used to implement Artificial Intelligence
 Used to design User interface ex: Windows

4. Limitations of OOPs OR Disadvantages of OOPs


 The writing of flow diagrams for object oriented program is a complex process
 To convert real world problem into an object Oriented Model is difficult
 The classes are overly generalized
 OOP software is not having Set Standards
5. Characteristics of OOP OR Features of OOP OR Basic concepts of OOP
 Classes
 Objects
 Data abstraction
 Data encapsulation
 Inheritance
 Polymorphism
Class:
 class is a way of grouping the objects having similar characteristics
Ex: Planets, Sun, Moon are members of the class Solar System
Object:
 Objects are basic building blocks for designing programs. It may represent a person, place or a
table of data
 Object is a collection of data members and associated member functions
Data abstraction:
 The process of representing the essential features without including the background details is called Data
abstraction.
17
Data Encapsulation:
 it is the process of combining data and functions into single unit
 It prevents the direct access of data

Inheritance:

 It is an ability of one class to inherit properties from another class


 Base class- it is a class whose properties are inherited by another class
 Derived class- it is a class which inherits the properties from base class

Polymophism:

 It is an ability of using an operator or function in more than one form

6. Difference between Object oriented Programming(OOP) with Procedural Oriented Programming (POP)

OOP POP
 The program is divided into number  The program is divided into number
of small subprograms called function of objects
 It follows top down approach  It follows bottom-up approach
 Importance is not given to data but  Importance is given to data
importance is given only to
procedure
 Data is not hidden  Data is hidden
 Data may communicate with each  Object may communicate with each
other through functions other through functions

6. Classes and objects:


1. Write syntax and example for defining the class
OR
Write general structure for defining class

Ans: Syntax or General structure

class class_name
{
private: member data;
member functions;
protected: member data;
member functions;
public: member data;
member functions;
};

18
Ex: class sum
{
private: int a,b;
protected: int c;
public:
void process()
{
a=10;
b=20;
c=a+b;
cout<<”sum is=”<<c;
}
};
void main()
{
sum s;
s.process();
}

2. What is an access Specifier? Explain.


It specify the scope of data within the class.
Types: private, protected and public
private: The members of private are not accessed from outside the class
protected: The members of protected can be accessed in derived class.
public: The public members can be accessed both inside the class and outside the class

Ex:
class sum
{
private: int a,b;
protected: int c;
public:
void process()
{
a=10;
b=20;
c=a+b;
cout<<”sum is=”<<c;
}
};
void main()
{
sum s;
s.process();
}

19
3. Explain defining member function inside the class definition.
Ans: in this method a function is defined inside the class without using scope resolution operator

Synatx:

class class_name
{
private:
public: return_type function_name(args)
{
------------------------
------------------------
}
};

Ex:
class sum
{
private: int a,b,c;
public:
void process()
{
a=10, b=20;
c=a+b;
cout<<”sum is=”<<c;
}
};
void main()
{
sum s;
s.process();
}
4. Explain defining member function outside the class definition.
Ans: in this method a function can be defined outside the class by using scope resolution operator.

Synatx:

class class_name
{
private:
public: return_type function_name(args);
};
return_type class_name::function_name(args)
{
------------------------
------------------------
------------------------
}

20
Ex:
class sum
{
private: int a,b,c;
public:
void process();
};
void sum::process()
{
a=10;
b=20;
c=a+b;
cout<<”sum is=”<<c;
}
void main()
{
sum s;
s.process();
}

5. Explain the defining of objects


OR
Explain the defining of class and object with syntax and example.

Ans: once a class is defined we can create any number of objects for that class

Synatx:
class class_name
{
private: member data;
member functions;
protected: member data;
member functions;
public: member data;
member functions;
};
main()
{
class_name object1, object2..........;
}

21
Ex:
class sum
{
private: int a,b,c;
public:
void process()
{
a=10;
b=20;
c=a+b;
cout<<”sum is=”<<c;
}
};
void main()
{
sum s;
s.process();
}

6. Explain the characteristics of member function.


 Member function of class can access the private data of that class.
 The number of arguments and type of arguments must be same in both declaration and definition of the
function
 The same function name can be used in different classes
 The scope resolution operator(::) is used to define member function outside the class
7. Function Overloading:
1. What is function overloading? Explain with syntax and example.
Two or more functions have same name but different number of arguments or different types of arguments
called Function overloading
Synatx:
return_type function_name(data_type arg1)
{
-------------
--------------
}
return_type function_name(data_type arg1, data_type arg2)
{
-------------
--------------
}
return_type function_name(data_type arg1, data_type arg2, data_type arg3)
{
-------------
--------------
}

22
Ex:
class shapes
{
public:
float area(float a)
{
return(a*a);
}
float area(float l, float b)
{
return(l*b);
}
float area(float l, float b, float h)
{
return(l*b*h);
}
};
void main()
{
sum s;
s.process();
}
2. Explain with a programming example to overload a function with different number of arguments.
Ans: In function overloading we are using two or more functions have same name with different number of
argument or different types of arguments.
Ex:

class shapes
{
public:
float area(float a)
{
return(a*a);
}
float area(float l, float b)
{
return(l*b);
}
float area(float l, float b, float h)
{
return(l*b*h);
}
};
Void main()

23
{
shapes s;
cout<<”area of square=”<<s.area(5.2);
cout<<”area of rectangle=”<<s.area(5.2, 7.5);
cout<<”area of cube=”<<s.area(5.2,5.8,9.1);
}
4. Explain with a programming example to overload a function with different data type arguments.
Ans: In function overloading we are using two or more functions have same name with different number of
argument or different types of arguments.
Ex:

class sum

{
public:
void process(int x, int y)
{
cout<<”sum of two integer numbers=”<<x+y;
}
void process(float x, float y)
{
cout<<”sum of two float numbers=”<<x+y;
}
};
Void main()
{
sum s;
s.process(5,10);
s.process(8.5,14.8);
}

5. Write the need of function overloading


OR
write the advantages of function overloading.
Ans:
 We can call same function for different operations with different arguments
 It simplifies the programmer task by reducing number of function names to be remembered
 Easier interface between programs and real world objects
 Code maintenance is easy
 It is easy to understand the flow of information and de-bugging
6. What is inline function? Explain with syntax and example.
Ans: it is small function where the compiler replaces the function call statement with the function code itself.
Syntax:
Inline return_type function_name(args)
{
-------------
--------------
}
24
Ex:
#include<iostream.h>
#include<conio.h>
inline int cube(int a)
{
return(a*a);
}
void main()
{
int n;
clrscr();
cout<<”Enter a number”;
cin>>n;
cout<<”cube is =”<<cube(n);
getch();
}
7. Explain Friend function with syntax and example.
Ans: Friend function is a non-member function of the class and used to access the private and protected
members of class

class class_name
{
private:
public:
friend return_type friend_function_name(args);
};
return_type friend_function_name (args)
{
-------------
--------------
}

Ex:
class sum
{
private: int a,b;
public: void input()
{
a=10, b=20;
}
friend void process(sum);
};
void process(sum s1)
{
cout<<”sum is=”<<s1.a + s1.b;
}
25
void main()
{
sum s;
s.input();
process(s);
}
8. Write the characteristics of Friend function.
 A friend function is not a member function of class but it has full access rights to private and protected
data of class
 Friend function cannot be called using the object of that class
 Friend function can be declared in anywhere of the class (either in private or protected or public)
 It cannot access members directly, with the support of object only it can access the members
 It is declared with the keyword friend but while defining it does not use either friend or scope resolution
operator
8. Constructors and destructors
1. What is constructor? Write syntax and example.
Ans: it is a special member function of class which is executed automatically when the object is created and used
to initialize the object
Syntax:

class class_name
{
private: variables;
public: class_name()
{
----------------
----------------
----------------
}
};

Ex:
class sum
{
private: int a,b;
public: sum()
{
a=10;
b=20;
cout<<”sum is=”<<a+b;
}
};
void main()
{
sum s;
}

26
2. Rules for writing a constructor or Characteristics of a constructor
 The name of constructor is the same name as that of the class name
 There is no return type for constructor
 The constructor should be declared in the public section
 Constructors are executed automatically when the objects are created
 It is not possible to refer the address of constructors
 Constructors makes implicit calls to the new and delete operations
3. Types of constructors
 Default constructor
 Parameterized constructor
 Copy constructor
4. Explain default constructor with syntax and example.

class_name::class_name( )
{
-------------
--------------
}
void main()
{
class_name object_name;
}
Ex:
class sum
{
private: int a,b;
public: sum( )
{
a=10, b=20;
cout<<”sum is=”<<a+b;
}
};
void main()
{
sum s;
}
5. Write the features of default constructor.
 For every object is created, the default constructor is automatically invoked
 All objects are initialized to same values
6. Explain parameterized constructor with syntax and example

Ans: a constructor which accepts one or more arguments is called Parameterized constructor

Syntax: class_name::class_name(arg1, arg2 ---------- )


{
-------------
--------------
---------------
}
void main()
{ 27
class_name object_name(arg1, arg2,...........);
}
Ex:
class sum
{
private: int x,y;
public: sum(int a, int b )
{
x=a, y=b;
cout<<”sum is=”<<x+y;
}
};
void main()
{
sum s(10,20);
}

7. Write the features of Parameterized constructor.


 Parameterized constructor can be overloaded
 For an object created with one argument, constructor with only one argument is invoked and executed

8. Explain copy constructor with syntax and example.


It is a Parameterized constructor which is used to copy the values of one object to another object
class_name::class_name(class_name &pointer)

Ex:
class sum
{
private: int a,b,c;
public: void input()
{
a=10, b=20;
}
void process(sum &s)
{
c=s.a + s.b;
cout<<”sum is =”<<c;
}
};
void main()
{
sum s1, s2;
s1.input();
s2.process(s1);
}
28
9. Explain destructors with syntax and example.
It is a special member function which is automatically executed when the object is destroyed.

Synatx:
class class_name
{
private:
public:
class_name()
{
------------
------------
}
~class_name()
{
-------------
-------------
}
};

Ex:
class sum
{
private: int a;
public: sum()
{
a=10;
}
~sum()
{
cout<<”object destroyed”;
}
};
void main()
{
sum s;
}
10. Characteristics of destructors OR Rules for destructors
 Destructor name is same as that of class name and preceded by tilde(~) operator
 There is no return type for destructor
 Destructors are invoked automatically when the objects are destroyed
 Destructors cannot be overloaded
 It is not possible to take the address of a constructor

29
9. INHERITANCE
1. What is inheritance? Explain single inheritance with example.
it is the capability of one class to inherit the properties from another class.
Single Inheritance: in this inheritance a class is derived from single base class i.e one base class and one derived
class

Father

Son

Syntax:
class base_class
{
protected: --------
public: ---------
};
class derived_class: visibility_mode base_class
{
private: -----------
protected: -----------
public: -------------
};
Ex:
class addition
{
protected: int a,b;
public: void input()
{
a=10,b=20;
}
};
class sum:public addition
{
protected: int c;
public: void process()
{
c=a+b;
cout<<”sum is =”<<c;
}
};
void main()
{
sum s;
s.input();
s.process();
}

30
2. Explain different types of inheritance.
 Single Inheritance
 Multi level Inheritance
 Multiple Inheritance
 Hierarchical Inheritance
 Hybrid Inheritance
Single Inheritance: in this inheritance a class is derived from a single base class i.e only one base class and one
derived class
Base class Father

Derived class Son

Multi-level Inheritance: in this inheritance a class is derived from a class that is already derived

Base class Grand Father

Derived class1 Father

Derived class2 Son

Derived class n

Multiple Inheritance: in this inheritance a class is derived from more than one base class

Base class1 Base class2 ------- Base class n

Derived class

King Queen

Prince

31
Hierarchical Inheritance: in this Inheritance, number of classes is derived from a single base class

Derived class

Base class1 Base class2 Base class n

Staff

Lectures Office staff Group-D

Hybrid Inheritance: it is the combination of hierarchical and multilevel inheritance

Base Class

Fruits
Derived class 1 Derived class 2

Apple Banana
Derived class 3

Fruit salad

3. Advantages of Inheritance
 We can reuse an existing code
 Faster development time
 Easy to maintain
 Easy to extend
 Memory Utilization

4. What is visibility mode? Explain private and public inheritance.


It specifies whether the features of base class are privately derived or protected derived or public derived in
derived class

Private Inheritance:
 The private members of base class cannot be inherited
 The protected members of base class becomes private in derived class
 The public members of base class becomes private in derived class
Syntax:

class derived_class:private base_class

32
Ex:
class addition
{
private: int a;
protected: float b;
public: void input();
};
class sum:private addition
{
public: void process();
};

Protected Inheritance:
 The private members of base class cannot be inherited
 The protected members of base class stay protected in derived class
 The public members of base class becomes protected in derived class

class derived_class:protected base_class


Ex: class addition
{
private: int a;
protected: float b;
public: void input();
};
class sum:protected addition
{
public: void process();
};

Public Inheritance:
 The private members of base class cannot be inherited
 The protected members of base class becomes public in derived class
 The public members of base class stay public in derived class

class derived_class:public base_class


Ex: class addition
{
private: int a;
protected: float b;
public: void input();
};
class sum:public addition
{
public: void process();
};

33
10. POINTERS
1. What is pointer?
Pointer is a special variable, which stores the address of another variable
2. Write declaration syntax of pointer variable.

data_type *variable;
Ex: int *ptr;
3. Write declaration syntax and example for Integer pointer variable.

int *variable;
Ex: int *ptr;
4. Write declaration syntax and example for float pointer variable.

float *variable;
Ex: float *ptr;
5. Write declaration syntax and example for Character pointer variable.

char *variable;
Ex: char *ptr;

6. How do you initialize a pointer?


int a, *b;
a=10;
b=&a;
10. Operations on pointers
 We can add an integer value to a pointer
 We can subtract an integer value from a pointer
 We can compare two pointers if they point to the elements of same array
11. Advantages of Pointers
 It is possible to write efficient programs
 Memory is utilized properly
 Dynamically allocate and de-allocate memory
 Easy to deal with hardware components
12. Relation between pointer and array
 There is a close relationship between pointers and arrays
 When program is running the compiler does not store address of all elements of array, It can store only
the address of First element
int a[4]={10,20,30,40}
int *b;
b=a;
Here initializing the address of first element to the pointer variable
13. Explain array of pointers.
It can store the address of many elements of same type

34
Syntax:

data_type *array_name[size];
Ex: int a,b,c,d,*ptr[4];
ptr[0]=&a;
ptr[1]=&b;
ptr[2]=&c;
ptr[3]=&d;
14. Write difference between static and dynamic memory Allocation

Static Memory Allocation Dynamic Memory Allocation

1) Memory is allocated during 1) Memory is allocated during


compilation execution
2) No memory allocation and de- 2) Memory bindings are
allocation actions are established and destroyed
performed during execution during execution
3) Variables remain permanently 3) Variables are allocated only
allocated when the program unit is in
active
4) It is implemented using stacks 4) It is implemented using data
and heaps segments

15. What is the use of new operator?


new operator is used to allocate memory to the variables during execution
16. What is the use of delete operators?
It is used to de-allocate the memory during execution

11.DATA FILE HANDLING


1. What is stream?
It is a sequence of bytes, it reads data from keyboard and stored in memory and transfer data from memory into
output device
2. Different types of streams.
 ifstream(Input File Stream): it contains the functions related to file input operations
 ofstream(Output File Stream): it contains the functions related to file output operations
 fstream(File Stream): it contains the functions related to both input and output operations

3. types of files
 Text file
 Binary file
Text file: in this file the data is stored in the form of ASCII characters
Binary file: in this file the data is stored in the form of binary digits

35
4. Explain different file opening modes.
 ios::out
 ios::in
 ios::trunk
 ios::app
 ios::ate
 ios::binary
iss::out -in this mode the file is opened to write data to file
iss::in -in this mode the file is opened to read data from file
iss::app -it appends new data at the end of output file
iss::binary -the file is opened in binary form
5. Functions
a) get(): it reads a single character from text file
b) getline(): it reads an entire line from text file
c) put(): it writes a single character to text file
d) read(): it reads binary data from binary file
e) write(): it writes binary data to binary file
f) seekg(): it moves the get pointer to the specified location in the file
g) seekp(): it moves the put pointer to the specified location in the file
h) tellg(): it returns the current position of get pointer
i) tellp(): it returns the current position of put pointer

6. Write the functions belong to ifstream class.


or
Write functions used to perform input operations on file
 get()
 getline()
 read()
 seekg()
 tellg()

7. Write the functions belong to ofstream class.


or
Write functions used to perform output operations on file
 put()
 write()
 seekp()
 tellp()
8. write the functions used in text file
 get()
 getline()
 put()
9. write the functions used in Binary file

36
 read()
 write()
10. Difference between ifstream and ofstream

ifstream ofstream

1) It is use to read data from file 1) It is used to write data to file

2) Input File Stream. It contains input 2) Output File Stream. It contains output
operations related functions operations related functions
3) It contains get(), getline(), read(), 3) It contains put(), write(), seekp(),
seekg(), tellg() tellp()

12.DATA BASE CONCEPTS


1. What is data and information?
Data: it is a collection of facts, figures and statistics which is in incomplete form
Information: it is the processed data which is in meaningful form
2. What is database?
It is a collection logically related data
3. Difference between manual data processing and computerised data processing

Manual data processing(MDP) Electronic data processing (EDP or CDP)


1. The volume of data processed is 1. The volume of data processed is
limited very large

2. It requires large quantity of paper 2. It requires less quantity of paper


3. The speed and accuracy is limited 3. High speed and gives accurate
results

4. Labour cost is high 4. Labour cost is economical


5. Storage medium is paper 5. Storage medium is secondary
storage memory
6. Computer is not used 6. Computer is used to process

4. Explain data processing cycle


Data
gathering
Data output Data input

Process

Storage

Data collection: collecting required data from various places


37
Data input: the collected data must be input into the computer system using various input devices
Data processing: series of operations performed on the input data to produce outputs
Storage: the result is stored in memory
Output: the result is available to the user either on monitor or on the paper
Communication: taking input from a for distance, processed in a remote area stored in different places and
then transmitted by an email
5. DBMS: Data Base Management System
Ex: Oracle, Sybase, My SQL
6. What is tuple or record?
Each row in a table is called tuple or record
7. What is data mining?
The process of extracting useful pattern from large volume of data is called data mining
8. Components of ER-diagram.
Entity

Attribute

Relationship

SQL:
1. Expand SQL:
Ans: Structured Query Language
 It provides Commands for creation, deletion, accessing and modifying the data in database table.
2. Explain arithmetic operators in SQL.
it is used to perform arithmetic operations
Ex: a=10 b=20
+ Addition a+b=30
- Subtraction a-b= -10
* multiplication a*b=200
/ Division- it returns quotient value a/b=0.5
3. Explain Comparison
% Modulus- it returns remainder value a%b=0 (Relational) operators in SQL.
it is used to perform Relational operations i.e it compares the relation between the operands

= To check whether the values of two variables are equal or not a=b is not true
!= To check whether the values of two variables are equal or not a!=b is true
<> To check whether the values of two variables are equal or not a<>b is not true
> To check whether the value of one variable is greater than the second variable or not a>b is not true
< To check whether the value of one variable is Less than the second variable or not a<b is true
>= To check whether the value of one variable is greater or equal than the second variable a>=b is not true
Ex: a=10 b=20
38
4. Explain Logical operators in SQL.
 AND: it allows the existence of multiple conditions in an SQL statement WHERE clauses. True when all
conditions are true otherwise the output will be false
 OR: the OR operator is used to combine multiple conditions in an SQL statement. false when all conditions
are false otherwise the output will be true
 NOT: the NOT operator reverses the meaning of the logical operator
 IS NULL: This operator is used to compare a value with a NULL value.
 BETWEEN: it is used to search the values within a range
 ALL: it is used to compare a value to all values in another value set.
5. What is DDL? Write the DDL commands.
DDL-Data Definition Language. It is used to perform operations on table ie create, alter and delete the table
Ex: Create, Alter, Drop
6. What is DML? Write the DML commands.
DDL-Data Manipulation Language. It is used to perform operations on Records(rows) ie Insert, modify and
delete the Records
Ex: Insert, Update, delete
7. Explain CREATE command with syntax and example.
It is used to create a new table
Synatx: Ex:
CREATE TABLE Table_Name CREATE TABLE STUDENT
( (
Column1 datatype,
RegNo NUMBER(6),
Column2 datatype,
………………………….. Name VARCHAR2(25),
………………………… Fees NUMBER(4,2)
Co1umn N datatype );
PRIMARY KEY (one or more columns)
);

8. Explain ALTER command with syntax and example.


It is used to modify the table
Syntax: Alter table table_name Add(Columnn1 data type, column2 data type…………………column n data type);
Ex: ALTER TABLE STUDENT ADD (comb VARCHAR2 (6), DOB date);
9. Explain DROP command with syntax and example.
It is used to delete the table
Syntax: DROP table table_name;
Ex: DROP TABLE STUDENT;
10. Explain INSERT command with syntax and example.
It is used to insert new records into the table
Syntax:
INSERT INTO Table_Name (Column1, Column2 …. Column n) VALUES (value1, Value2 …. Value n);

Ex:
INSERT INTO STUDENT (RegNo, Name, Combination) VALUES (1401, ‘MANEESH’, ‘pcmc’);

11. Explain UPDATE command with syntax and example.


39
It is used to modify the records on table
Synatx:
UPDATE Table_Name SET co1unn1 = value1, co1unn2 = value2 …………. co1unn n = value n WHERE (condition);
Ex: UPDATE STUDENT SET Fees = 15000 Where(regno=100);
12. Explain DELETE command with syntax and example.
It is used to delete the records from table
Synatx: DELETE FROM Table_Name WHERE (condition);
Ex: Delete from student where(regno=101);
13. Explain SELECT command with syntax and example.
It is used to display the data from table
Synatx: SELECT *from Table_Name;
Ex: Select *from Student;
14. Explain group functions (Aggregate Functions) in SQL.
 SUM():It is used to find the sum of the numeric column.
 MAX(): It is used to find the maximum values in a column.
 MIN():It is used to find the minimum values in a column.
 COUNT():It gives the number of rows in a table based on the condition
 AVG():It is used to find the average of the values in a numeric column.
 DISTINCT():It is used to select the distinct rows
Web designing:
1. WWW- World Wide Web
2. HTTP: Hyper Text Transfer Protocol
3. URL: Uniform Resource locator
4. FTP: File Transfer Protocol
5. TCP-Transmission Control Protocol, IP-Internet Protocol
6. Wi-Fi: Wireless Fidelity
7. SIM: Subscriber Identity Module
8. CDMA: Code division Multiple Access
9. GSM: Global System for Mobile Communications
10. What is HTML?
It is used to design web pages
11. HTML: Hyper Text Markup Language
12. What is the file extension to store HTML program?
Ans: .html
13. Explain any three text formatting tags or any three tags in HTML:
 <B>: it display text in Bold
 <U>: it display text with Underline
 <I>: it display text in Italic style
14. Explain any three Re-sizing text tags in HTML:
 <BIG>: it makes the text into bigger size by increasing its size by 1
 <SMALL>:it makes the text into smaller size by decreasing its size by 1
 Heading Tags: <H1>: it displays the text in large size
<H2>: it displays the text smaller than H1
15. Explain any text layout tags in HTML:

40
 <center>: it displays the information at center of webpage
 <br>:it is used to add a single line break. It does not have closing tag.
 <p> : it adds a paragraph break after the text.
16. Explain General Structure of HTML:
Ans: Refer in notes
17. What is web browser? Give examples for web browsers.
It is used to display web pages
Ex: Chrome, Mozilla firefox, Internet explorer, opera
18. What is E-Commerce? Explain its types.
It is the way of selling and buying goods and services over the internet (Online)
1) Business to Business(B2B): The trading of goods, services and informationfrom one business to another
Business organization.
2) Business-to-Consumer (B2C): The exchange of services, information and products from a Business
organization to a consumer.
3) Consumer-to-Business(C2B): Customer directly contact with business company by giving technology, idea
and advice
4) Consumer-to-consumer (C2C): it is the business between two consumers without involving any business
organization as a mediator
19. What is web hosting? Explain its types.
Hosting an application in a server where the content is readily available to any user in the internet
Types: 1) free hosting: hosting webpages at free of cost
2) Virtual or shared hosting: hosting web pages on the webserver along with other websites
3) Dedicated hosting: hosting web pages in server where an entire web server is reserved for one
Website
20. What is web Scripting? Explain its types.
It is the Process of creating and embedding scripts in a webpage
 Client side scripts:
The Client side scripts are downloaded at the client end and then interpreted and executed by the browser
 Server side Scripts:
Server side scripting enables the completion of a task at server end and then sending the result to the
client end

21. What is XML?


 XML is a text based markup language used to describe the data i.e it is the standard for data interchange
on the web
 XML tags are case sensitive
 XML can be used to store data
 In xml all tags must contains ending tags
22. DHTML (Dynamic Hypertext Markup Language):
 It enables a web page to response to a user input without sending requests to the web server .
23. What is Domain name?
It is a unique name that identifies a computer on the internet

24. What is OSS? Write its features?


41
 OSS-Open Source Software
 Source code is available freely
 We can study and modify the software
 We can redistribute the software
25. What is Free Software? Write its features?
It is available at free of cost
 Source code is available freely
 We can study and modify the software
 We can redistribute the software
26. What is Freeware? Write its features?
It is available at free of cost
 Source code is not available
 We cannot modify the software
 We can redistribute the software
27. What is Shareware? Write its features?
It is available with right to redistribute and it can be used only for a stipulated time.
 After some time license fee should be paid
 Source code is not available
 We cannot modify the software
28. What is Proprietary Software? Write its features?
 It is not freely available
 Source code is not available ie it is not an open source software
 We can use, distribution required to take special permission from the supplier
29. Website: Collection of webpages
30. Webpage: The documents residing on web sites are called Web Pages and it contains text, pictures etc
31. Web Server or Server: It contains websites and It responds to the requests made by web browsers.
32. Explain any five Network devices?
 Modem: it converts digital signal into analog signal and analog into digital form
 Hub: It is used to connect several computers together
 Switch: it is used to segment networks into different subnetworks
 Repeater: it amplifies a signal being transmitted on the network.
 Bridge: it links two networks together.
 Ethernet card: it is used to connect network cable to the computer

33. What is antivirus? Give examples for antivirus.


42
It is used to identify and delete the viruses from the computer
Ex: Panda, AVG, Avasta, Kasperskey, K7, Norton360 etc
34. Write Virus prevention methods.
 Never use a foreign disk or CD without scanning
 Always scan files downloaded from internet
 Write protect your disks
 Use licensed software
 Install and use Anti-virus software
 Keep antivirus software up to date
 Password protect your PC
31. Computer network: interconnection of many computers
32. Internet: interconnection of many networks
33. Network Topology: Actual Layout of the network
Types of topology: Refer notes
35. Transmission modes: Simplex, Half duplex, full duplex refer notes
36. Switching techniques: Circuit switching, message switching, packet switching refer notes
34. Types of Network:
LAN(Local Area network)- Computers are connected within a small area
MAN(Metropolitan Area Network): Computers are connected within a city
WAN(Wide Area Network): Computers are connected across the country or world

43

You might also like