2 PUC Computer Notes(2024)Final Copy (2)
2 PUC Computer Notes(2024)Final Copy (2)
onwards
www.gkmvkalyan.blogspot.com Page 1
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 2 of 240
www.gkmvkalyan.blogspot.com Page 2
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 3 of 240
www.gkmvkalyan.blogspot.com Page 3
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 4 of 240
www.gkmvkalyan.blogspot.com Page 4
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 5 of 240
www.gkmvkalyan.blogspot.com Page 5
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 6 of 240
UNIT-A
www.gkmvkalyan.blogspot.com Page 6
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 7 of 240
c. Port d. Registers
a. Only RAM b. Only ROM c. Both RAM and ROM d. Flash drives
www.gkmvkalyan.blogspot.com Page 7
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 8 of 240
a.only form factor b.only Chip set c.Only Processor Socket d. All the
above
a.Form Factor b. Chip set c. Processor socket d. All from (a) to (c)
16. Which among the following motherboards have slot type and PGA
type processor sockets
www.gkmvkalyan.blogspot.com Page 8
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 9 of 240
a. ATX motherboard
b. Baby AT motherboard
c. XT motherboard
d. AT motherboard
a. 24 b. 12 and 20 c. 20 d. 20 and 24
a. Baby AT b. ATX c. AT d. XT
21. Choose the very old motherboard model from the following
a. ATX b. XT c. Baby AT d. AT
a. AT motherboard
b. Baby AT motherboard
c. ATX motherboard
d. XT motherboard
www.gkmvkalyan.blogspot.com Page 9
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 10 of 240
a. multiprocessor
b. graphic processor
c. microprocessor
d. microcomputer
31. Which one of the following is the alternative name for North Bridge
a. Host Bridge b. LPC c. North Chipset d. Both (a) and (c) are correct
34. Identify the devices which are not managed by North Bridge
a. RAM b. CPU c. Video cards d. CD ROM drive
39 is a type of memory chip to store the date, time and system setup
parameters.
40. BIOS and CMOS are powered by battery kept on the motherboard
a. Lithium Ion b. Sodium Ion
b. Magnesium ion d Silicon Ion
www.gkmvkalyan.blogspot.com Page 11
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 12 of 240
a. Hard Disk
b. Floppy Disk
c. Any External disk drive
d. All of the above
51. Which of the following are the two main components of the CPU?
a). Control Unit and Registers b). Registers and Main Memory
c). Control unit and ALU d). ALU and bus
www.gkmvkalyan.blogspot.com Page 12
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 13 of 240
Architecture
c) Industrial Standard Auxiliary device d) International standard advice
55. VGA is
a). Video Graphics Array b). Visual Graphics Adapter
c) Visual Graph Array d) Visual Gate Array
www.gkmvkalyan.blogspot.com Page 13
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 14 of 240
1) What is Motherboard?
The motherboard is the main Printed Circuit Board (PCB) inside a
computer which provides a platform for all the components and
peripherals to communicate with each other.
2) What is microprocessor?
5) What is bus?
A bus is a collection of parallel wires that form a pathway to carry
address, data and control signals.
www.gkmvkalyan.blogspot.com Page 14
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 15 of 240
www.gkmvkalyan.blogspot.com Page 15
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 16 of 240
www.gkmvkalyan.blogspot.com Page 16
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 17 of 240
Expand
PCI-Peripheral Component Interconnect.
BIOS-Basic Input Output System.
SCSI- Small Computer System Interface.
USB- Universal Serial Bus.
MIDI- Musical Instruments Digital Interface.
CMOS-Complementary Metal Oxide Semiconductor memory.
UPS-Uninterruptable Power Supply.
DRAM: Dynamic Random Access Memory
SRAM: Static Random Access memory
SDRAM: Synchronous Dynamic Random Access Memory
DDR-SDRAM: Double-Data Rate Synchronous Dynamic Random
Access Memory
AGP-Accelerated Graphics Port.
VGA-Visual Graphics Adaptor.
DVI- Digital Video Interface.
ISA- Industry Standard Architecture.
SIMM-Single Inline Memory Module.
DIMM-Dual Inline Memory Module.
POST-Power on Self Test.
www.gkmvkalyan.blogspot.com Page 17
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 18 of 240
www.gkmvkalyan.blogspot.com Page 18
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 19 of 240
www.gkmvkalyan.blogspot.com Page 19
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 20 of 240
XT Motherboard:
1. XT motherboard: XT stands for eXtended Technology. These
are old model motherboard. In this motherboard we have slot type
processors, ISA slots, 12 pin power connector and no ports.
Ex: Pentium I, Pentium II Processors.
www.gkmvkalyan.blogspot.com Page 20
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 21 of 240
The north bridge or host bridge is one of the two chips in the core
logic chipset on a PC motherboard, used to manage data
communications between the CPU and motherboard.
North Bridge or north Chipset is responsible for control of high
speed components like CPU, RAM, and Video Card.
www.gkmvkalyan.blogspot.com Page 21
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 22 of 240
www.gkmvkalyan.blogspot.com Page 22
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 23 of 240
8. Write the functions for data bus, address bus and control bus.
Data bus: Data bus provides the path to transfer data and
instructions between CPU and Memory.
Address bus: Address bus connects CPU and RAM, which carries
address of the data in the memory to store and retrieve the data.
Control bus: Control bus carries control signals sent from CPU to
different parts of the computer.
www.gkmvkalyan.blogspot.com Page 23
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 24 of 240
www.gkmvkalyan.blogspot.com Page 24
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 25 of 240
www.gkmvkalyan.blogspot.com Page 25
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 26 of 240
www.gkmvkalyan.blogspot.com Page 26
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 27 of 240
Data bus: Data bus provides the path to transfer data between CPU
and Memory.
Address bus: Address bus connects CPU and RAM, which carries
address to store and retrieve the data.
Control bus: Control bus is used to control the access and the use
of the data and address lines.
18. What is the purpose of ports, buses and disk controller in the I/O
System?
Ports: Port is a connector used to connect external devices like
printers, scanners etc, to the computer.
Buses: A bus is a collection of parallel wires that forms a path way
to carry electrical signals over the components of computer.
Disk Controllers: Disk controller is a circuit that enables the CPU
to connector with Hard disk drive, Floppy Disk Drive and other disk
drives
www.gkmvkalyan.blogspot.com Page 27
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 28 of 240
www.gkmvkalyan.blogspot.com Page 28
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 29 of 240
www.gkmvkalyan.blogspot.com Page 29
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 30 of 240
www.gkmvkalyan.blogspot.com Page 30
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 31 of 240
www.gkmvkalyan.blogspot.com Page 31
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 32 of 240
www.gkmvkalyan.blogspot.com Page 32
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 33 of 240
www.gkmvkalyan.blogspot.com Page 33
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 34 of 240
www.gkmvkalyan.blogspot.com Page 34
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 35 of 240
www.gkmvkalyan.blogspot.com Page 35
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 36 of 240
Quick references
a) Find the Maxterm for X+Y’+Z
The Maxterm is X’.Y.Z’
b)
c) What are the fundamental products for each of the input words;
ABCD = 0010, ABCD = 1101, ABCD = 1110. Write SOP expression.
A + A’B = A + B
A.(A’+B) = A.B
A.A’ +A.B=A.B
A.B=A.B (A.A’=0)
www.gkmvkalyan.blogspot.com Page 36
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 37 of 240
g) Construct a truth table for three variables A, B and C that will have
output 1 when ABC = 100, ABC = 110 and ABC = 111. Write the
boolean expression for logic network in the SOP form.
www.gkmvkalyan.blogspot.com Page 37
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 38 of 240
i) Construct a truth table for minterms and maxterms for three variables
and designate the terms.
www.gkmvkalyan.blogspot.com Page 38
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 39 of 240
k)
www.gkmvkalyan.blogspot.com Page 39
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 40 of 240
www.gkmvkalyan.blogspot.com Page 40
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 41 of 240
Minterms
Minterm is a product of all the literals (with or without the bar) within the
logic system.
One of the most powerful theorems within Boolean algebra states that
any Boolean function can be expressed as the sum of products of all the
variables within the system. For example, X+Y can be expressed as the
sum of several products, each of the product containing letters X and Y.
These products are called Minterms and each product contains all the
literals with or without the bar. Also when values are given for different
variables, minterm can easily be formed.
Example: if X=0, Y=1, Z=0 then minterm will be X'YZ' i.e., for variable
with a value 0, take its complement and the one with value 1, multiply it
as it is. Similarly for X=1, Y=0, Z=0, minterm will be XY'Z'.
www.gkmvkalyan.blogspot.com Page 41
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 42 of 240
www.gkmvkalyan.blogspot.com Page 42
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 43 of 240
Theorm-2
The complement of the product of two or more variables is equal to
the sum of the complements of the variables.
www.gkmvkalyan.blogspot.com Page 43
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 44 of 240
Theorm-1
The complement of the sum of two or more variables is equal to the
product of the complement of the variables.
www.gkmvkalyan.blogspot.com Page 44
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 45 of 240
Theorm-2
The complement of the product of two or more variables is equal to
the sum of the complements of the variables.
www.gkmvkalyan.blogspot.com Page 45
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 46 of 240
Theorm-2
The complement of the product of two or more variables is equal to
the sum of the complements of the variables.
www.gkmvkalyan.blogspot.com Page 46
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 47 of 240
www.gkmvkalyan.blogspot.com Page 47
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 48 of 240
Single Variable K-Map: - There are two Minterms (A and A’) for one
variable.
- Hence the map consists of 2 squares. (i.e. 2n square, 21 = 2square)
Two Variable K-Map: - There are four Minterms (A’B’, A’B, AB’ and AB
for two variable).
Hence the map consists of 4 squares (i.e. 2 n square, 22 = 4square)
www.gkmvkalyan.blogspot.com Page 48
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 49 of 240
Each square represents a min-term or a max-term. Enter 1’s for the min
terms in the expression (0’s for the Maxterms).
www.gkmvkalyan.blogspot.com Page 49
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 50 of 240
www.gkmvkalyan.blogspot.com Page 50
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 51 of 240
www.gkmvkalyan.blogspot.com Page 51
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 52 of 240
Reduced terms
Pair-1=A’BD
Pair-2=CD’B
Pair-3=CD’A
Pair-4=AB’C’
www.gkmvkalyan.blogspot.com Page 52
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 53 of 240
www.gkmvkalyan.blogspot.com Page 53
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 54 of 240
www.gkmvkalyan.blogspot.com Page 54
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 55 of 240
www.gkmvkalyan.blogspot.com Page 55
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 56 of 240
www.gkmvkalyan.blogspot.com Page 56
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 57 of 240
www.gkmvkalyan.blogspot.com Page 57
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 58 of 240
h)
www.gkmvkalyan.blogspot.com Page 58
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 59 of 240
www.gkmvkalyan.blogspot.com Page 59
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 60 of 240
www.gkmvkalyan.blogspot.com Page 60
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 61 of 240
www.gkmvkalyan.blogspot.com Page 61
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 62 of 240
2) Explain basic logic gates with standard symbol and truth table.
AND Gate: - The AND Gate can have two or more input signals and
produce one output signal. When all the inputs are high (1) then the
output is high (1). Otherwise, the output is low(0).
OR Gate: - The OR Gate has two or more input signals but only one
output signal. If any one of the input signal is 1 (High) then the output
signal is 1 (High) otherwise output signal is 0 (Low).
www.gkmvkalyan.blogspot.com Page 62
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 63 of 240
Inverter (NOT gate):- An inverter is a gate with one input signal and one
output signal, the output state is always the opposite of the input state.
NOR Gate: - The NOR gate has two or more input signals but only one
output signal. If all the inputs are 0(Low), then the output signal is
1(High) otherwise output signal is 0(Low).
www.gkmvkalyan.blogspot.com Page 63
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 64 of 240
www.gkmvkalyan.blogspot.com Page 64
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 65 of 240
www.gkmvkalyan.blogspot.com Page 65
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 66 of 240
www.gkmvkalyan.blogspot.com Page 66
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 67 of 240
Just Remember
www.gkmvkalyan.blogspot.com Page 67
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 68 of 240
www.gkmvkalyan.blogspot.com Page 68
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 69 of 240
www.gkmvkalyan.blogspot.com Page 69
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 70 of 240
www.gkmvkalyan.blogspot.com Page 70
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 71 of 240
www.gkmvkalyan.blogspot.com Page 71
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 72 of 240
www.gkmvkalyan.blogspot.com Page 72
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 73 of 240
www.gkmvkalyan.blogspot.com Page 73
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 74 of 240
a) Row-Major Order :
In row-major order, all the first-row elements are stored in
sequential memory locations and then all the second-row elements
are stored and so on.
www.gkmvkalyan.blogspot.com Page 74
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 75 of 240
www.gkmvkalyan.blogspot.com Page 75
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 76 of 240
10) Write an algorithm for insert element into a one dimensional array.
Algorithm: A is the array with N elements. ITEM is the element to
be inserted in the position P.
Step 1: for I = N-1 down to P
A[I+1] = A[I]
End of for
Step 2: A[P] = ITEM
Step 3: N = N+1
Step 4: Exit
www.gkmvkalyan.blogspot.com Page 76
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 77 of 240
www.gkmvkalyan.blogspot.com Page 77
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 78 of 240
www.gkmvkalyan.blogspot.com Page 78
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 79 of 240
www.gkmvkalyan.blogspot.com Page 79
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 80 of 240
www.gkmvkalyan.blogspot.com Page 80
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 81 of 240
www.gkmvkalyan.blogspot.com Page 81
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 82 of 240
www.gkmvkalyan.blogspot.com Page 82
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 83 of 240
Step4:Exit
www.gkmvkalyan.blogspot.com Page 83
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 84 of 240
www.gkmvkalyan.blogspot.com Page 84
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 85 of 240
Simple Queue: In Simple queue insertion occurs at the rear end of the
list, and deletion occurs at the front end of the list.
Priority queue – In this queue, data elements are accepted as per the
time of occurrence and insertion and deletion of elements takes place
according to the priority mentioned in the queue.
www.gkmvkalyan.blogspot.com Page 85
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 86 of 240
www.gkmvkalyan.blogspot.com Page 86
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 87 of 240
www.gkmvkalyan.blogspot.com Page 87
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 88 of 240
www.gkmvkalyan.blogspot.com Page 88
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 89 of 240
www.gkmvkalyan.blogspot.com Page 89
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 90 of 240
Garbage collection:
If a node is deleted from the linked list or if a linked list is deleted, we
require the space to be available for future use. The memory space of
the deleted nodes is immediately reinserted into the free-storage list.
The operating system of the computer periodically collects all the
deleted space into the free-storage list. This technique of collecting
deleted space into free-storage list is called as garbage collection.
Pros
Uses memory efficiently as contiguous memory is not required
for allocating data items.
The length of the data items is not necessary to be known prior
to allocation.
Cons
Overhead of the link to the next data item.
www.gkmvkalyan.blogspot.com Page 90
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 91 of 240
www.gkmvkalyan.blogspot.com Page 91
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 92 of 240
www.gkmvkalyan.blogspot.com Page 92
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 93 of 240
**********
www.gkmvkalyan.blogspot.com Page 93
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 94 of 240
UNIT-B
www.gkmvkalyan.blogspot.com Page 94
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 95 of 240
Derived Class: It is the class that inherits properties from base class
(es).It is also called Sub Class.
www.gkmvkalyan.blogspot.com Page 95
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 96 of 240
www.gkmvkalyan.blogspot.com Page 96
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 97 of 240
www.gkmvkalyan.blogspot.com Page 97
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 98 of 240
www.gkmvkalyan.blogspot.com Page 98
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 99 of 240
www.gkmvkalyan.blogspot.com Page 99
II PUC Computer Notes www.gkmvkalyan.blogspot.com Page 100 of 240
void main()
{
GKClass X; // X is the object of class GKClass created
X.display();
}
Where
class is a keyword in C++.
class_names is the name of the class and can be treated as
the user defined data type.
The pair of flower braces indicates the body of the class.
The semicolon (;) after the right brace is must.
The variables are declared inside and are called data
members.
The member functions can access or manipulate data
members without passing them as parameters.
The private, protected and public are access specifiers for the
members of class.
3) Explain member function inside the class definition with syntax and
example.
To define member function inside a class the function declaration
within the class is replaced by the actual function definition inside
the class. A function defined in a class is treated as inline function.
Only small functions are defined inside class definition.
Syntax:
return_type member_function(arguments_list)
{
function body;
}
Example:
Example:
Note:
A friend function is useful when a function to be shared between the two
classes by making a function as a friend to both the classes, thereby
allowing a function to access private and protected data members of both
classes.
Chapter-10 INHERITANCE
Public inheritance:
The public members of a base class become public member of the
derived class.
The private members cannot be inherited to the derived class.
The protected members stay protected.
Private inheritance:
The public members of base class become the private members of
derived class.
The private members cannot be inherited to the derived class.
The protected members become private members in the derived
class.
Protected inheritance:
The public members of a base class become the protected in a
derived class.
The private members cannot be inherited to the derived class.
The protected members will stay protected in the derived class.
Chapter-11 POINTERS
ptr=&n;
Example:
10) Name the stream classes supported by C++ for file input and
output.
ifstream, ofstream, fstream, filebuf, fstreambase.
13) Write the difference between text file and binary file.
15) What is the use of eof( ) and tellp( ) with respect to files.
eof( ): it helps in detecting the end of file. Once the end of
file is detected with the use of eof() member function, we can stop
reading further.
put():
The put() member function belongs to the class ofstream.
The function put() writes a single character to the associated
stream.
Syntax: ofstream_object.put(ch);
get( ):
The get() member function belongs to the class
ifstream.
The function get() reads a single character from the
associated stream.
Syntax: ifstream_object.get(ch);
getline( ):
It is used to read a whole line of text.
It belongs to the class ifstream.
Syntax: fin.getline(buffer, SIZE);
2) List the different modes of opening a file with their meaning in C++.
(OR)Explain any three modes to open a file in C++(OR)
Discuss the file mode parameters in C++?
6) Mention the methods of opening file within C++. Discuss any one.
The method of opening a file within C++ programs
Opening a file using Constructor.
Opening a file using open() member function.
Opening a file using constructor:
a. Opening a file for output purpose only.
Syntax: ofstream filestreamobject(“filename”);
Example: ofstream myfile(“results.dat”);
tellg()
• Belongs to ifstream class
• To return current position of get pointer
• Syntax: int position; position=fin.tellg()
tellp()
• Belongs to ifstream class
• To return current position of put pointer
• Syntax: int position; position=fin.tellp()
**********
UNIT-C
One Mark MCQ’s and 5 fill up the blanks Question and Answer.
1) What is data?
Data is a collection of facts, figures, statistics, which can be
processed to produce meaningful information.
2) What is information?
Information is processed data with some definite meaning.
3) What is database?
A Database is a collection of logically related data organized in such
a way that data can be easily accessed, managed and updated.
4) Define DBMS.
A Data Base Management System is software that allows creation,
definition and manipulation of database.
6) What is a field?
Each Column is identified by a distinct header called attribute or
field.
7) What is a record?
A row in a table is called Record or tuple.
8) What is an entity?
An entity is an object or a record which contains a set of attributes.
9) What is an instance?
The data stored in database at a particular moment of time.
π (pi)
13) Define sequential access, direct access and indexed sequential access
file organizations.
Sequential access: It is a type of file organization in which the records
are arranged one after another in an ascending or descending order of a
particular key field.
Direct access: It is a type of file organization in which the records
are stored and accessed directly using a relative record number.
Indexed sequential access: This file organization combines the
features of both sequential and direct file organization. The records are
stored sequentially, but they can be accessed randomly through an index.
15) Write the different symbols used in E-R diagram with their
significance
b) Network Model:
The data is organized in the form of graphs.
In this model the data is represented by the collection of
records, and relationships among data are represented by
links.
Each record represents a node. All the nodes are linked to
each other without any hierarchy.
c) Relational Model:
Dr. E.F.Codd first introduced the Relational Database Model.
This model allows data to be represented in a ‘simple row-
column format’. Data is organized in two-dimensional tables
called relations.
In a table, each row (record) represents an entity and a
column (field) represents an attribute of the entity.
The relationship between the two tables is implemented
through a common attribute in the tables.
This makes the querying much easier in a relational database
system.
20) What is the difference between serial and direct access file
organization?
Disadvantages:
It uses special software and is expensive.
Extra time is taken to maintain index.
Extra storage for index files.
Expensive hardware is required.
Disadvantages:
a) Entire file must be processed even if a single record is to be
accessed.
b) Transactions have to be sorted before processing.
c) Random enquire is not possible cannot access middle record
directly. Data redundancy is high, as same data can be stored
at different places with different keys.
Advantages Dis-advantages
The network data model is that The network data model is that it
a can be quite complicated to
parent node can have many maintain all the links and a single
child broken link can lead to problems
nodes and a child can also have in the database. In addition
many parent nodes. Thus, the the database design can become
network model permits the complex.
modeling of many-to-many
relationships in data.
Conceptual level: This level is also known as logical level. This level
describes what data is stored in the database.
32) Write the difference between hierarchical data model and network data
model.
Advantages Dis-Advantages
The hierarchical data model is The hard coded link is
that the data access is quite established permanently and
predictable in the structure and cannot be modified.
therefore both the retrieval and
updates can be highly optimized
by the DBMS.
DELETE DROP
DELETE is a Data Manipulation DROP is a Data Definition
Language command. Language command.
DELETE remove some or all the DROP can remove entire
rows from a table. schema, table, domain, or
constraints from the database.
WHERE clause can be used along WHERE clause is not used in
with the DELETE command. DROP command.
Actions performed by DELETE Actions performed by DROP
can be roll-backed. cannot be roll-backed.
13) What is the difference between ORDER BY and GROUP BY clause used
in SQL? Give example for each.
ORDER BY GROUP BY
ORDER BY clause is used to sort GROUP BY clause is used in
the data in ascending or collaboration with the SELECT
descending order, based on one statement to arrange identical
or more columns. data into groups.
Example: Example:
select * from gktab order by select COUNT(*) from gktab
name;
where deptname=’Computer
Science’;
17) Give the syntax and Example for Alter command in SQL.
The ALTER TABLE statement is used to add, delete, or modify columns
in an existing table.
a) ALTER TABLE - ADD Column
To add a column in a table, use the following syntax:
ALTER TABLE tablename ADD NewColumnname Datatype(size);
Example
ALTER TABLE gktab ADD Email varchar(60);
1) Explain the various group functions in SQL. (OR) What are group
functions in SQL? Explain group functions with example.
b) MAX(): This function is used to get the maximum value from a column.
c) MIN(): This function is used to get the minimum value from a column.
7) Expand SQL. Give the syntax and example for INSERT and DELETE
command in SQL
INSERT Command
Syntax:
INSERT INTO tablename VALUES(value1, value2, value3,...);
Example:
INSERT INTO gkemp VALUES(101,’Nisarga’,’F’);
DELETE Command
Syntax:
DELETE FROM tablename WHERE condition;
Example:
DELETE FROM gkemp WHERE empid=105;
Constraints are the rules enforced on data columns on table. These are
used to limit the type of data that can go into a table. This ensures the
accuracy and reliability of the data in the database.
The constraints available in SQL are Primary Key, Foreign Key, Not Null,
Unique and Check.
▪ PRIMARY KEY: A primary key is a field which can uniquely identify
each row in a table.
▪ FOREIGN KEY: A foreign key is a field in a relational table that
matches the primary key column of another table.
▪ NOT NULL: This constraint tells that we should have values
compulsorily to this column.
▪ UNIQUE: This constraint tells that all the values in the column must
be unique. That is, the values in any row of a column must not be
repeated.
▪ CHECK: This constraint helps to validate the values of a column to
meet a particular condition. That is, it helps to ensure that the value
stored in a column meets a specific condition.
Example:
create table gkpk(regno number(3) primary key,
name varchar(20) not null,
adharno number(12) unique,
age number(3) check (age>3));
SELECT Command
The SELECT statement is used to fetch the data from a database table
which returns this data in the form of a result table.
Syntax:
SELECT column1, column2 ...columnN FROM tablename WHERE
Condition;
Example:
a) If you want to select all the fields available in the table.
SELECT * FROM gktab;
b) If you want to sort the names in alphabetic order.
SELECT * FROM gktab ORDER BY name;
c) If you want to select specific columns like regno, name from the
table.
SELECT regno, name FROM gktab;
12) Write the differences between order by and group by with example.
13) What is DDL? Explain any two DDL commands used in SQL.
CREATE Command
ALTER Command
DROP Command
14) What is DML? Explain any two DML commands used in SQL.
INSERT Command
UPDATE Command
The below UPDATE command is used to modify the all the rows in a table.
DELETE Command
The below DELETE command is used to delete the specific row in a table.
The below DELETE command is used to delete all the rows in a table.
SELECT Command
The below SELECT command displays all rows and columns from the
table.
The below SELECT command displays all the column and specific
row(s) from the table.
15) Write the SQL command to develop following table also find Total,
Maximum and Minimum marks in the table.
16)
Answer:
*****
UNIT-D
2) What is server?
Server is a main computer which facilitates sharing of resources and
service in a network.
3) What is client?
A client is a computer attached to a network and seeking the
services from the server.
4) What is topology?
The actual appearance or layout of network is called network
topology.
5) Expand 2G.
Second-Generation cellular technology.
6) What is a virus?
Virus is a malicious program that is designed to infect the host
program and gain control over the system without the owner's
knowledge.
7) What is chatting?
It is the method of online communication by typing text messages
which can be instantly received by the recipient and he can respond
back at the same time.
Simplex Mode
Half-Duplex Mode
4. List the differences between simplex, half duplex and full duplex.
Shielded Twisted Pair (STP): This twisted cable consisted of a foil shield to
block external interference. The insulation within these types of the
twisted cable allow greater data transmission rate. These are used in fast-
data-rate Ethernet and in data and voice channels of telephone lines.
Coaxial Cable:
This cable contains an external plastic cover and it includes two parallel
conductors where each conductor includes a separate protection cover.
This cable is used to transmit data in two modes like baseband mode as
well as broadband mode. This cable is widely used in cable TVs & analog
TV networks.
The advantages of the coaxial cable include high bandwidth, noise
immunity is good, low cost and simple to install.
Optical Fiber Cable:
It uses electric signals to transmit data. At the centre is the glass core
through which light propagates. It is used for large volume data
transmission. Fiber optic cable has bandwidth more than 2 gbps
(Gigabytes per Second)
The main advantages of this cable include lightweight, capacity &
bandwidth will be increased, signal attenuation is less, etc. The
disadvantages are high cost, fragile, installation & maintenance is difficult
and unidirectional.
Bus Topology
Bus topology is also known as Linear Topology. In this type of topology,
each node attaches directly to a common cable which acts as the
backbone onto which the various nodes are attached.
Star Topology
In this topology each node is connected directly to the central computer.
All the communications between the nodes have to pass through central
computer.
Tree Topology
Tree topology is a combination of bus and star topology. The network
looks like an inverted tree with the central root branching and sub-
branching down to the nodes.
Ring Topology
In ring topology, each host machine connects to exactly two other
machines, creating a circular network structure. When one host tries to
communicate or send message to a host which is not adjacent to it, the
data travels through all intermediate hosts.
Mesh Topology
In this topology, each node is connected to more than one node to
provide an alternative root in the case the host is either down or too
busy.
a) Circuit Switching
When a dedicated path is established for data transmission between
sender and receiver, it is called circuit switching. When any network node
wants to send data, a call request signal is sent to the receiver and
acknowledged back to ensure availability of dedicated path. This
dedicated path is then used to send data. ARPANET used circuit switching
for communication over the network.
b) Message Switching
In this techniques the message is transmitted through the network node
to node, each node receives the entire message stores it and then is
transmitted to the next node due to that, this type of network is called as
store and forward. The device needs the sufficient storage capacity to
buffer the message.
c) Packet Switching
Packet Switching is one of the switching techniques in which messages
are divided into packets before they are sent. Each packet is then
transmitted individually and can even follow different routes to its
destination. Once all the packets arrived at the destination, they are
recompiled into the original message.
1) What is freeware?
A freeware is an application software that is available free of cost and
which allows copying and further distribution, but not modification and
whose source code is not available.
2) Define E-Commerce.
E-commerce is the trade of goods and services with the help of
Telecommunication and computers.
3) Expand WWW.
World Wide Web
Where type: specifies the type of the server in which the file is located,
address is the address of server, and path tells the location of file on the
server.
For example, in the following URL
Example:
http://www.pue.kar.nic.in/results.asp
a) The type of server or protocol.
b) The name or address of the server on the Internet.
c) The location or path of the file on the server
Where type: specifies the type of the server in which the file is
located.
address is the address of server.
path tells the location of file on the server.
For example, in the following URL
http://www.pue.kar.nic.in/results.asp
IPR plays a key role in almost every sector and has become a
crucial factor for investment decisions by many companies. All the
above Acts and regulations are at par with international standards.
India is now TRIPS-compliant. This is an international agreement
administered by the World Trade Organization (WTO), which sets
down minimum standards for many forms of intellectual property
1) What is HTML?
HTML is known has Hypertext Markup Language, which is used to
create websites.
*.html
4) Write any one HTML tag
<HTML> Marks the beginning of HTML.
5) What is DHTML?
Dynamic Hypertext Markup Language.
6) Expand XML.
eXtended Markup Language
1. Client-Side Scripts
Client-Side scripting enables interaction within a web page.
The client-side scripts are downloaded at the client-end and then
interpreted and executed by the browser. The client side scripting is
browser dependent. Client-side scripting is used when the client-
side interaction is used.
2. Server-side scripts
Server-side scripting enables the completion or carrying out a task
at the server end and then sending the result to the client end.
In server side script, the server does all the work, so it doesn't
matter which browser is being used at client end.
Some popular server side scripting languages are PHP (Hypertext
Pre Processor)
Example:
<html>
<head>
<title>MY Time Table</title>
</head>
<body bgcolor="PINK">
<H1><center>Study Time Table</center></H1>
<table border="3" align="center">
<tr>
<th>Day/Time</th>
<th>7:00-8:00</th>
<th>8:00-8:30</th>
<th>8:30-9:30</th>
<th>9:30-10:30</th>
</tr>
<tr>
<td>MONDAY</td>
<td>Home Work</td>
<td>Dinner</td>
<td>Physics</td>
<td>Computer</td>
</tr>
</table></body></html>
14) What are the advantages and disadvantages of www? Or Give the
advantages of Internet.
Advantages of the WWW:
1. E-Mail: E-mail is an online correspondence system. With e-mail,
you can send and receive instant electronic messages. Your
messages are delivered instantly to people anywhere in the world.
2. Access Information: The Internet is a treasure of information.
Any kind of information on any topic is available on the Internet.
The ‘search engines’ on the Internet can help you to find data on
any subject that you need.
3. Shopping: One can also buy and sell goods online. There are
many online stores and sites that can be used to look for products
as well as buy them using a credit card.
4. Downloading Software: One can download a lot of games,
music, videos, movies from the Internet, most of which are free.
Disadvantages of the Internet: