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

cs notes1

Uploaded by

madan01mady
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)
15 views

cs notes1

Uploaded by

madan01mady
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/ 28

CHAPTER-12:

DATA FILE HANDLING

Three Marks Questions:


1. Mention the methods of opening file within C++ program. Discuss.
Ans: File can be opened in 2 ways

1)Opening file using constructor


2) Opening file using open( ) member function
1.Opening file using constructor
This method is used when a single file is used with a stream.
a) Opening a file for output purpose only using an object of ofstream class and the constructor.
Syntax:
ofstream ofstream_object(“file_name”);
Example:
ofstream fout(“result.dat”);
b) Opening a file for input purpose only using an object of ifstream class and constructor
Syntax:
ifstream ifstream_object(“file_name”);
Example:
ifstream fin(“result.dat”);

2. Opening file using open( )


a) Opening a file for ouput purpose only using an object of ofstream class and open() member function.
Syntax:
ofstream_object.open(“file_name”);
Example:
ofstream fp;
fp.open(“student.dat”);
b) Opening a file for input purpose only using an object of ifstream class and open( ) member function
Syntax:
ifstream_object.open(“file_name”);
Example:
ifstream fp;
fp.open(“book.dat”);

2. Differentiate between ifstream class and ofstream class


Ans:
ifstream ofstream
1.It is a stream class to read from files 1.It is a stream class to write on files
2.This class supports input operations 2.This class supports output operations
3.It contains open( ) with default input mode 3.It contains open( ) with default output mode

3. Differentiate between read( ) and write()


Read() Write()
1. It belongs to the class ifstream 1.It belongs to the class ofstream
2. It reads binary data from a file. 2. It writes binary data to a file.
3.Syntax: ifstream_object.read((char*)&variable, 3.Syntax:
sizeof (variable)); ofstream_object.write((char *) &variable, sizeof
(variable));
4. Differentiate between get( ) and getline( ).
get( ) getline( )
1. It reads a single character from the associated 1.It is used to read a whole line of text
stream.
2.Syntax: ifstream_object.get(ch); 2. Syntax: ifstream_object.getline(buffer,size);
Example: Example:
char ch=’a’; char book[size];
ifstream fin(“text.txt”); ifstream fin;
fin.get(ch); fin.getline(book,size);

5. Name the stream classes supported by C++ for file input and output.
Classes Meanings
ifstream It is a stream class to read from files. It provides input operations for file. It inherits get(
),getline( ),read( ) ,seekg( ) and tellg( ) functions from istream class

ofstream It is a stream class to write on files. It provides output operations for file. It inherits put(
),write( ), seekp( ) and tellp( ) functions from ostream class.
fstream It is stream class to both read and write from/to files. It provides support for simultaneous
input and output operations. It inherits all the functions from istream and ostream classes.

6. Mention the types of file. Explain.


Ans: There are 2 types of files
1. Text file2. Binary file
1. Text File
It is a file that stores information in ASCII characters. Each line of text is terminated with a special character
known as EOL(End of line) character or delimiter character. In this file certain internal translation takes place.
2. Binary File
It is a file that contains information in the same format as it is held in memory. No delimiters are used
to terminate line of text. Also no translation takes place
7. What are the advantages of saving data in binary form and text form?
1. Binary files are faster and easier for a program to read and write than the text file.
2. It takes less space to store data.
3. It eliminates conversion between internal and external representation.
Five marks questions:
1. What are input output streams?
 The stream that supplies data to the program is known as input stream. It reads the data from the file
and transfers it to the program.
 The stream that receives data from the program is known as output stream. It writes the received data
to the files.
2. What is significance of fstream.h header file.?
fstream.h is a header file of C++ standard library which is used to implement input/output operations.
The fstream library predefines a set of operations for handling files related to input and output.
It defines certain classes that help to perform file input and output operations.
It consists of ifstream ,ofstream and fstream classes.
ifstream It is a stream class to read from files. It provides input operations for file. It inherits
get( ),getline( ),read( ) ,seekg( ) and tellg( ) functions from istream class
ofstream It is a stream class to write on files. It provides output operations for file. It inherits
put( ),write( ), seekp( ) and tellp( ) functions from ostream class.
fstream It is a stream class to both read and write from/to files. It provides support for
simultaneous input and output operations. It inherits all the functions from istream
and ostream classes.
3. Mention the methods of opening file within C++ .Discuss.
Ans: File can be opened in 2 ways
1) Opening file using constructor
2) Opening file using open( ) member function
1. Opening file using constructor
This method is used when a single file is used with a stream.
a) Opening a file for output purpose only using an b)Opening a file for input purpose only using an
object of ofstream class and the object of ifstream class and constructor
constructor.
Syntax: Syntax:
ofstream ofstream_object(“file_name”); ifstream ifstream_object(“file_name”);
Example: Example:
ofstream fout(“result.dat”); ifstream fin(“result.dat”);

2. Opening file using open( )

a) Opening a file for ouput purpose only using an b) Opening a file for input purpose only using an
object of ofstream class and open() member function. object of ifstream class and open( ) member
function
Syntax: Syntax:
ofstream_object.open(“file_name”); ifstream_object.open(“file_name”);
Example: Example:
ofstream fp; ifstream fp;
fp.open(“student.dat”); fp.open(“book.dat”);
4.
Differentiate between ifstream class and ofstream class
ifstream ofstream
1.It is a stream class to read from files 1.It is a stream class to write on files
2.This class supports input operations 2.This class supports output operations
3.It contains open( ) with default input mode 3.It contains open( ) with default output mode
4.It inherits get( ),getline( ),read( ),seekg( ) and 4. It inherits put(),write(),seekp() and tellp()
tellg( ) functions from istream function from ostream
5.Example: ifstream fb; fb.open(“text.dat”); 5.Example: ofstream fb; fb.open(“text.dat”);

5. Differentiate between read( ) and write( ) with example.


read( ) write( )
1. It belongs to the class ifstream 1.It belongs to the class ofstream
2.It reads binary data from a file. 2. It writes binary data to a file.
3.Syntax: 3.Syntax: fout.write((char *) &variable,
fin.read((char*)&variable,sizeof(variable)); sizeof(variable))
4.Example 4.Example
student s; student s;
ifstream fin(“std.dat”,ios::binary); ofstream fout(“std.dat”,ios::binary);
fin.read((char*)&s,sizeof(s)); fout.write((char*)&s,sizeof(s));

6. Differentiate between get( ) and getline( ).


get( ) getline( )
1. It reads a single character from the associated 1.It is used to read a whole line of text
stream.
2.Syntax: ifstream_object.get(ch); 2. Syntax: ifstream_object.getline(buffer,size);
Example: Example:
char ch=’a’; char book[size];
ifstream fin(“text.txt”); ifstream fin;
fin.get(ch); fin.getline(book,size);

7. Explain file modes.


File mode parameter Meaning Stream Type
ios::app Append to end of file ofstream
ios::in Open file for reading only ifstream
ios::out Open file for writing only ofstream
ios::ate Open file for updation and move the file ifstream,ofstream
pointer to the end of file
ios::binary Opening a binary file ifstream,ofstream

8. Differentiate between ios::in and ios::out


ios::in ios::out
1.It belongs to ifstream class 1.It belongs to ofstream class
2.It opens file for reading only 2.It opens file for writing only
3.Example: 3.Example:
fstream fin(‘text.dat”,ios::in); Open fstream fout(“text.dat”,ios::out); open
text.dat in input mode text.dat in output mode
CHAPTER 13:
DATABASE CONCEPTS
1. What is record?
A row in a table is called as record.
2. Define data mining.
Process of analyzing and picking information from large volume of data.
3. What is tuple?
Collection of related fields is known as tuple. ( OR ) Each row in a table is called as tuple.
4. What is an attribute?
Each column of a table is identified with distinct header called attribute. ( OR ) Named
column(header) of a table is called as attribute.
5. What is an entity?
An entity is an object OR a record contains a set of attributes.
6. What is data base?
A database is a collection of large amount of related data. In other words, it is collection
of tables. OR It is a collection of related data organized with a specific structure(table)
stored on a suitable storage device.
7. What is table?
A table is a collection of related data elements organized in terms of rows and columns.
8. What is key?
It is a column or columns which identifies each row or tuple. ( OR ) It is a set of one or more
attributes whose combined values are unique in all the rows of a table.
9. What is foreign key?
A foreign key is a key used to link two tables together. ( OR )
It is an attribute in one table which matches with the primary key attribute of another table.
10. Define primary key.
The key (attribute) which is used to uniquely identify each record in a table is called primary
key.
OR Primary key is an attribute(field) in a table which is unique in each row(record) of a table.
11. What is domain?
It is defined as a set of allowed values for one or more attributes.
12. What is normalization?
Normalization is a step by step process of removing the different kinds of redundancy and
anomaly one step at a time from the database. ( OR ) It is the process of removing anomalies,
data redundancy and data inconsistency from the database.
Two marks questions:
1. Define primary key and candidate key.
 Primary key: The key(attribute) which is used to uniquely identify each record in a table
is called as primary key.
 Candidate key: When more than one attribute serves as unique, then each attribute is
called as candidate key.
2. What is data independence? Mention the types of data independence.
Data independence is an ability of a database to modify the schema definition at one level
without affecting in the other level.
 Physical data independence
 Logical data independence
3. What are the advantages of ISAM?
 It permits quick access to selected records without searching the entire file.
 It permits efficient and economical use of sequential processing techniques when the
activity ratio is high.
 It combines best features of sequential and direct access.
4. What is DBMS? Give an example of DBMS software.
 DBMS is a software that allows definition, creation and manipulation of data in a
database.  Examples for DBMS: Oracle, SQL Server
5. Write the differences between data and information.
 Data is a collection of facts, numbers, letters or symbols which can be processed to
produce meaningful information. Ex- 16,Ram
 Processed data with some definite meaning is called as information. Ex;
studentname=’Ram’ age=16
6. Mention the data base users.
The broad classification of database
users are 1. Application
programmer and system analysts.
2. End users
3. Database Administrators(DBA)
4. Database Designers
5.

Three Marks questions


1. Explain data base users.
 DBA (Database administrator): Responsible for authorization access to database,
monitoring the user of database, acquiring the needed software and hardware resources.
 Database designers: Responsible for identifying what data to be stored in a database,
choosing appropriate structure to represent and store the data.
 Application programmer: Implement the user requirement in the program.
2. Briefly explain 1-tier database architecture.
 In one-tier architecture, the user directly uses the only entity DBMS.
 Any changes made will be directly done on DBMS itself.
 This architecture is used by data base designer and programmers.
3. Briefly explain 2-tier database architecture.
 Two-tier client/server architecture is used for User Interface program and application
programs that runs on client side.
 It uses an interface called ODBC (Open Database Connectivity) which provides an API
that allows client-side programs to call the DBMS.
 A client programs can connect to several DBMS’s.
4. Briefly explain 3-tier database architecture.
 3-tier architecture is commonly used architecture for web applications.
 Intermediate layer called Application server or

 Web Server is used to store the web connectivity software and the business logic.
 These are part of application used to access the right amount of data from the data base
server.
 This layer acts like a medium for sending partially processed data between the database
server and the client.
4. Explain Radom/direct file organization.
 Direct access file organization allows immediate direct access to individual records on
the file.
 Here the records are stored in memory based on the address generated by the “hashing
algorithm” H(key field)=address, This algorithm also takes care of conflict which may
arise when 2 or more key field are mapped to the same address.
 This type of organization also allows the file to access sequentially.
5. Write the different symbols used in E-R diagram with their significance.
The different notations or symbols for E-R diagram are

6. Mention the database models and explain any one.


The broad classification of database models is,
1. Hierarchical data model
2. Network data model
3. Relational data model
Relational data model: In the relational data model, all data are maintained in the form of
tables, known as relations consisting of row and columns. Each row represents an entity and a
column represents an attribute of the entity. The relationship between the two tables is
implemented through a common attribute in the tables and not the physical links or pointers.
Advantages:
 Makes the querying much easier.
 Programmer friendly
 Easy to maintain the data organized in two-dimensional tables called relations.
  It has a strong mathematical foundation.
 This model is extremely simple and easy to implement through the use of keys

Hierarchical data model: This data Model organizes the data in a tree like structure. All the
nodes are linked to each other with a definite hierarchy. This model represents the nodes as
one-to-one and one-to many relationships.
Advantages:
 This model is easy to design and simple.
 The data access is quite predictable in the structure.
  Process of retrieval and updates are optimized.
Network data model: This data model organizes the data in the form of graph. All the nodes
are linked to each other without any hierarchy. It is a powerful model, but database design is
complicated. This model has many-to-many relationships on data. It has one parent node and
many child nodes known as dependants; hence the data access is easier.

8. Mention any three advantages of random/direct file organization.


 The access to and retrieval of records is quick and direct.
 Records need not be stored in a sequence prior to processing.
  Best used for online transaction.
Five marks questions:
1. Explain any five applications of DBMS.
1. Educational application- database are used to store the student’s information in the
schools, colleges and universities.
2. Medical application- patient’s records/history is stored in database for quick access.
3. Business applications: In shops, malls and share market business transactions are stored
in the database for online access.
4. Banking applications: The transaction details such as deposit, withdrawal or transfer of
amount from one ledger to another is stored in data bases. Thus, generating the
accounting statement is easy.
5. Telecommunication: It will maintain the records of following: Calls made ,Monthly bill,
Balance maintenance for prepaid cards, Communication networks
6. Railway and Airlines: Railway and airlines tickets are reserved from different places of
the world, so central database system is used where accessing is networks to do the
reservation.
2. Write the advantages (features) of DBMS.
1. Centralized data Management: the data is stored at a central location and is shared
among multiple users.
2. Controlled data redundancy: Data redundancy means duplication of data item in
different record and files.
3. Data sharing: The data stored in the database can be shared among multiple users and
multiple application programs if needed.
4. Data independence: Ability of modifying the data at one level without affecting the
schema in the other level.
5. Data security: Data is highly secured because it permits the data access through
authorized channel.
4. Write the difference between manual and electronic data processing system.
Manual Data Processing Electronic Data Processing
Volume of data processed is limited in a given time More data can be processed in given time
Large quantity of paper is required No paper is required
Speed is less Speed is more
Accuracy is limited Always accurate
Storage medium is paper Secondary storage is used
Repetitive task reduce the efficiency of human being Computer is never bored of repetitive task
4. Briefly explain the data processing cycle.
 Data Collection:
All required data items must be gathered together is called as data collection.
 Data input: The mechanism of providing the raw data into a data processing system.
 Data Process: Conversion of data into information is called as data process Processing
requires series of operation(functions).
 Data output: After the successful data processing activity, processed data is presented
to the user in the form of reports (hardcopy and softcopy).
 Data storage: The result must be stored in the secondary storage medium for future use.
 Maintenance: Depending on significance of information it has to be maintained with
possible securities.

CHAPTER 14

SQL
1) SYNTAX AND EXAMPLE FOR CREATE COMMAND.
This command is used to create a new table
SYNTAX:
CREATE TABLE tablename( column1 datatype, column2 datatype, column3 datatype,
....
);

EXAMPLE:
CREATE TABLE STUDENT
(
Regnum number(6),
Name varchar(25),
Combination char(5),
Dob date,
Fees number(4,2),
);

2) SYNTAX AND EXAMPLE FOR ALTER COMMAND.


This command is used to add a new column or change data type of a column or delete a
column from existing table.
SYNTAX:
a) Alter table tablename add (columnname datatype);
b) Alter table tablename modify (columnname datatype);
c) Alter table tablename delete columnname;

EXAMPLE:
Alter table student add (addressvarchar(30));
Alter table student modify (addressvarchar(35));
Alter table student delete (address);

3) SYNTAX AND EXAMPLE FOR DROP COMMAND.


This command is used to delete an existing table from the
database. This command also removes records stored in
the database.

SYNTAX:
DROP TABLE table_name;

EXAMPLE:
DROP TABLE Shippers;

4) SYNTAX AND EXAMPLE FOR DELETE COMMAND.


This command is used to remove existing records from the table.
SYNTAX:
DELETE FROM table_name WHEREcondition;

EXAMPLE:
a) To delete all the records whose fees is less than 15,000.
DELETE FROM Student WHERE fees < 15000;
b) To delete all the records.
DELETE FROM Student;

5) SYNTAX AND EXAMPLE FOR UPDATE COMMAND.


This command is used to modify the existing data in the records of the table.
SYNTAX:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

EXAMPLE: //To decrease the fees of all student records by


500 UPDATE Student set fees = fees-500;

6) SYNTAX AND EXAMPLE FOR INSERT COMMAND.


This command is used to add new rows (records) into a table.
SYNTAX:
INSERT into tablename (column1, column2, ………) values (val1, val2, …..);

EXAMPLE:
//to insert data only for selected columns
INSERT into Student (Regnum, Name, Combination) values (123, ‘John’, ‘ceba’);

7) SYNTAX AND EXAMPLE FOR SELECT COMMAND.


This command is used to fetch data from the table. The output is also a table.
SYNTAX:
SELECT columnlist
FROM table_name
WHERE condition;

EXAMPLES:
a) SELECT Regnum, fees FROM Student;
b) SELECT * FROM Student;
c) SELECT Regnum, Name FROM Student WHERE totalmarks> 500;

8) WRITE THE DATATYPES SUPPORTED BY SQL.

1. CHARACTER [(length)] or CHAR [(length)]


2. VARCHAR (length)
3. BOOLEAN
4. SMALLINT
5. INTEGER or INT
6. DECIMAL [(p[,s])] or DEC [(p[,s])]
7. NUMERIC [(p[,s])]
8. REAL
9. FLOAT(p)
10. DOUBLE PRECISION
11. DATE
12. TIME
13. TIMESTAMP
14. CLOB [(length)] or CHARACTER LARGE OBJECT [(length)] or CHAR LARGE
15. OBJECT [(length)]
16. BLOB [(length)] or BINARY LARGE OBJECT [(length)]

9) WHAT IS A NULL VALUE?

 A field(column) with a NULL value, is a field with no value.


 A field with a NULL value is one that has been left blank during record creation.

10) WRITE THE DIFFERENCE BETWEEN ORDER BY AND GROUP BY.

 ORDER BY is used to sort the query result by specific columns.


  GROUP BY is used to arrange identical data into groups.

SYNTAX OF ORDER BY:


SELECT col1, col2, … FROM tablename [WHERE condition] ORDER BY col1,
col2,
EXAMPLE:
SELECT Name, Combination FROM Student ORDER BY Name;

This command gives list of names and combination in sorted order of names
(ascending order).
SYNTAX OF GROUP BY:
SELECT col1, col2, … FROM tablename WHERE condition GROUP BY col1,
col2, .. ; EXAMPLE:
SELECT Name, Combination FROM Student GROUP BY Combination;

11) WRITE ANY FIVE GROUP FUNCTIONS.


Group functions are built-in SQL functions that operate on groups of rows and return
one value for the entire group. These functions are: COUNT, MAX, MIN, AVG, SUM,
DISTINCT.

 COUNT (): This function returns the number of rows(records) in the table that satisfies
the condition specified in the WHERE condition. If the WHERE condition is not specified, then
the query returns the total number of rows present in the table.
Example:

SELECT COUNT (*) FROM employee WHERE dept = 'Electronics';


 DISTINCT(): This function is used to select the distinct rows (without
duplicates) present in the table.
Example:
SELECT DISTINCT dept FROM employee;

 MAX(): This function is used to get the maximum value from a column.
Example:
SELECT MAX (salary) FROM employee;

 MIN(): This function is used to get the minimum value from a column.
Example:
be: SELECT MIN (salary) FROM employee;

 AVG(): This function is used to get the average value of a numeric column.
Example:
SELECT AVG (salary) FROM employee;

 SUM(): This function is used to get the sum of a numeric column


Example:

SELECT SUM (salary) FROM employee;

13. EXPLAIN THE LOGICAL OPERATORS USED IN SQL.


a) IN OPEARTOR: The IN operator checks a value within a set of values
separated by commas and retrieve those rows from the table which are matching.
EXAMPLE:
SELECT Regnum, Combination FROM Student WHERE Combination IN
(‘PCMB’, ‘CEBA’); //this command gives only those records that match with
combination PCMB and CEBA.
b) NOT IN OPEARTOR: The NOT IN operator checks a value within a set of
values separated by commas and retrieve those rows from the table which are not
matching.
EXAMPLE:
SELECT Regnum, Combination FROM Student WHERE Combination NOT IN (‘PCMB’,
‘CEBA’); //this command gives those records that do no match with combination PCMB
and CEBA.

c) BETWEEN OPEARTOR: The BETWEEN operator tests an expression against a range. The
range consists of a beginning expression, followed by an AND keyword and an end expression.
EXAMPLE:
SELECT Regnum, Marks FROM Student WHERE Marks BETWEEN
550 AND 600; //this command gives the list of students whose marks
are between 550 and 600.
b) AND OPEARTOR:
EXAMPLE:
SELECT Regnum, Combination, Marks FROM Student WHERE Combination = ‘PCMB’
AND
Marks>500;
//this command gives the list of students whose combination is PCMB and marks
are more than 500.
SELECT Regnum, Combination FROM Student WHERE Combination IN (‘PCMB’,
‘CEBA’); //this command gives only those records that match with combination
PCMB and CEBA.
e) OR
OPEARTOR:
EXAMPLE:
SELECT Regnum, Combination FROM Student WHERE Combination = ‘PCMB’ OR
Combination=
‘HEBA’;
//this command gives the list of students whose combination is either
PCMB or HEBA.
f) IS NULL OPEARTOR:

EXAMPLE:
SELECT Regnum, Fees FROM Student WHERE Fees IS NULL;
//this command gives the list of students whose fees field is left blank.

12) EXPLAIN SQL CONSTRAINTS.


SQL constraints are used to specify rules for the data in a table.
Constraints can be column level or table level. Column level constraints
apply to a column, and table level constraints apply to the whole table.

The following constraints are commonly used in SQL:

1. NOT NULL - Ensures that a column cannot have a NULL value


2. UNIQUE - Ensures that all values in a column are different
3. PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each
row in a table
4. FOREIGN KEY - Uniquely identifies a row/record in another table
5. CHECK - Ensures that all values in a column satisfies a specific condition
6. DEFAULT - Sets a default value for a column when no value is specified
7. INDEX - Used to create and retrieve data from the database very quickly

13) EXPLAIN STRING FUNCTIONS (CHARACTER FUNCTIONS) IN SQL.


CHAPTER - 15
NETWORKING CONCEPTS
5) What is a server?
Ans: A server is a computer that contains all information that can be shared by other
computers. ( or ) A Server is a computer that facilitates the sharing of data, software, and
hardware resources like printers, modems etc on the network.

1) Write any two differences


between LAN and WAN.

LAN:

 Covers a few kilometres. Spans entire country.


 Data transfer rate is more than one mbps (1-10 mbps).
 Date transfer rate less than one mbps.
 Complete ownership by a single organization(private).
WAN:

 Owned by multiple organization.


 Very low error rates. Comparatively high error rates.

2) Explain the goals of


Networking.
a) Resource Sharing:
Irrespective of the physical location of the resources and the user, all programs, data and
peripheral are made available to anyone on the network.
b) Reliability and Security:
Files and programs on a network can be protected from illegal copying or modification.
c) Cost:
Networking versions of application software cost less when compared to the individual license
copies.
.
d) Speed:
Network provides very rapid method of sharing and transferring files(irrespective of
physical location).
e) Communication Medium:
Presence of networking and email systems makes the user to communicate online in a faster and
costeffective manner.

3) Explain communication modes and its types with example.


The direction (one way/ two way) of flow of information between two communication devices
is called as communication modes.
a) Simplex: Here data transfer occurs between only one transmitter and one or more receivers.
Eg: Radio, TV etc.
b) Half Duplex: Here data transfer occurs in both directions alternatively. That is one device is
sending and other can only receive the data and vice versa.
Eg: Walkie- Talkies, Marine/ Aviation etc.
c) Full Duplex: Here data is transmitted simultaneously in both directions on transmission
path. Here each serves(acts) as transmitter and receiver.
Eg: Modern Telephone

4) Explain the different types of switching techniques.


Linking of multiple paths between the sender and receiver is
called switching.
There are three types of switching techniques:
a. Circuit Switching
b. Message Switching
c. Packet Switching

Circuit Switching:
physical connection between sender and receiver is established in an unbroken path and then
data is transmitted from the source to destination
E.g: In telephone system, a complete path (end to end) must exist before communication
can take place
Message Switching (Store and forward):
there is no dedicated path is established between the sender and receiver. But the sender
appends a “destination address” to the data.
E.g: Telex forwarding

Packet Switching:
data is broken into distinct, addressed, fixed size parts called as packets, that can be transferred
separately via different paths. Each packet contains the address of sender, address of
destination, sequence number and some data. Finally, at the receiver end, packets are reordered
by sequence number and the original message is reconstructed.

FIVE Mark Questions:


1) What is Topology? Write a note on network topologies.
Network Topology refers to the arrangement of computers and other devices in a network.

1. Star Topology
In this type of topology, all the computers are connected to a single hub or a switch through a
cable. This hub is the central node and all others nodes are connected to the central node.
Advantages of a Star Topology

 Easy to install and wire.


 No disruptions to the network when connecting or removing devices.  Easy to detect
faults.
Disadvantages of a Star Topology

 Requires more cable length than a linear topology.


 If the hub, switch, or concentrator fails, nodes attached are disabled.
 More expensive than linear bus topologies because of the cost of the hubs, etc.
2. Ring topology
In a ring topology, all computers are connected via cable that loops in a ring or circle.

 A ring topology is a circle that has no start and no end.


 Each node connected to two neighbouring computers.
 Data accepted from one node transmitted to another.
 Data travels in one direction, from the node to node around the ring.
 Signal amplified at each node before being passed.

 Advantages of Ring Topology


• Short cable length
• No wiring closet space required  Suitable for optical fibers.
• Each client has equal access to resources.
Disadvantages

• Node failure causes network failure


• Difficult to diagnose faults
• Network reconfiguration is difficult

3. Tree Topology:
 A tree topology combines characteristics of linear bus and star topologies.
 It consists of groups of star-configured workstations connected to a linear bus backbone
cable.
 The tree network topology uses two or more star networks connected together.
 The central computers of the star networks are connected to a main bus. Thus, a tree
network is a bus network of star networks.
 Best suited for applications having hierarchical flow of data and control.

Advantages of a Tree Topology

 Point-to-Point wiring for individual segments.


 Supported by several hardware and software venders.
 Network can be easily extended.

 Disadvantages of a Tree Topology

 Use large cable length.


 If the backbone line breaks, the entire segment goes down.
 More difficult to configure and wire than other topologies.

4. Mesh Topology:
 In this topology each node is connected to two or more than two nodes.
 It is a point-to-point connection to other nodes or devices.
 Traffic is carried only between two devices or nodes to which it is connected.
 This topology is robust, provides security and privacy.
 Overall cost of this network is too high.
5. Graph Topology:
 In this topology, nodes are connected together in arbitrary fashion.
 A link may or may not connect two or more nodes.
 There may be multiple links also. But if a path is establishedin two nodes via one or
more  links is called a connected graph.

2) What is a virus? Write the characteristics (symptoms) of a computer virus.


Computer virus is a malicious program that requires a host computer and is designed to make a
system sick.

 It is able to replicate.
 It requires a host program as a carrier.
 It is activated by external action.\
 Its replication ability is limited to the system it entered.

3) Give the measures for preventing virus.

 Never use a CD without scanning it for viruses.


 Always scan files downloaded from the internet.
 Never boot your PC from floppy.
 Write protect your disks and make regular backup.
 Use licensed software.
 Password protects your PC.
 Install and use antivirus software.
 Keep antivirus software up to date.
 Some of the antiviruses are: Kaspersky, Quick Heal, K7, Norton 360, AVG, Avast,
MacAfee.

4) Explain any five applications of network communication.


SMS:
Short Message Service(SMS) is the transmission of short text messages (up to 160 characters)
to and from a mobile phone, fax machine and/or IP address.
Messages must be no longer than some fixed number of alpha-numeric characters and contain
no images or graphics.

Chat:
Exchange of typed in message by several people who are using the internet at the same time as
you are. In telephonic conversations, you say something, people hear it and respond, and you
hear their responses on the spot and can reply instantly.

Video Conferencing:
A two-way videophone conversation among multiple participations is called Video
Conferencing.
Wi-fi:
Wi-Fi is short for Wireless Fidelity, which lets you connect to the internet without a
direct line from your PC to the ISP. For Wi-Fi to work, you need:

 A broadband internet connection.


 A wireless router, which relays your internet connection from the “wall” to the
PC.
  A laptop or desktop with a wireless internet card or external wireless adapter.

Voice mail:
It is a method of storing voice message electronically for later retrieval by the intended
recipients.

CHAPTER 16
INTERNET AND OPEN SOURCE CONCEPTS
1.What is Open Source Software?
Open Source Software is a software which can be freely used but it does not have to
be free of charge
2. Define E-Commerce.
E-commerce is the trade of goods and services with the help of telecommunication
and computers.
3. Write any 2 Web browsers.


Internet
Explorer

Netscape
Navigato
r.
4. What is Web server?
Web Server is a WWW server that responds to the requests made by web browsers. Each website has a
unique address called URL (Uniform Resource Locator). ( or )
Web server is an internet host computer that may store thousands of websites. It responds to the
requests made by the web browsers. 5. Define Freeware
Freeware is a software which is available free of cost and which allows copying and further distribution,
but not modification and whose source code is not available.
7.What is HTTP?
Hyper Text Transfer Protocol is a network protocol used to send the message from source to destination.
8.What is web browser?
It is a software that enables the user to navigate through the www, to view webpage and move from one
website to another website.
8.What is WWW?
It is a “set of protocols” that allow users to access any document on the internet through the naming
system based on URL.

Three Marks questions:


1. Write the advantages of E-Commerce

 Global participation.
 Optimization of resources.
 Improved market intelligence and strategic planning.
 Buyer makes a buying decision, create the purchase order but does not print it.
 Reduced time to complete business transaction, particularly from delivery to payment.

2. Write the different types of E-Commerce


1. Business-to-Business(B2B)
2. Business-to-Commerce(B2C)
3. Consumer-to-Consumer(C2B)
4. Consumer-to-Consumer(C2C)
1. Business-to-Business (B2B): The exchange of services, information and/or products from one
business to another business partners. Ex: Ebay.com
2. Business-to-Consumer (B2C): The exchange of services, information and/or products from business
to consumers.
3.Consumer-to –Business(C2B): Customer directly contact with business vendors by posting their
project work with set budge online so that the needy companies review it and contact the customer
directly with bid. The consumer reviews all the bids and selects the company for further processing. Ex:
guru.com, freelancer. com.
4. Consumer-to-Consumer(C2C): Electronic commerce is an internet facilitated form of
business(commerce).

3. Write a note on OSS.


OSS refer to Open Source Software, which refer to software whose source code is available to customers
and it can be modified and redistributed without any limitations. An OSS may come free of cost or with a
payment of nominal charges that its developers may charge in the name of development, support of
software.

4. What is URL? Write the syntax and example.


HTTP uses internet addresses in a special format called a Uniform Resources Locator or URL.
OR
Address of file on internet is called as URL.
URLs look like this:

Type://address/path OR protocol://host/location
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.
http://encycle.msn.com/getinfo/styles.asp

5. What is Shareware? Write its limitations.


It is a software with the right to redistribute the copies.
But it is stipulated that if one intends to use the software often after a certain
period of time, then a license fee should be paid.

Limitations:

 Source code is not available.


 Modifications to the software are not allowed.

6. Define E-commerce. Write the various technologies and services used in E-commerce.
E-commerce is the trade of goods and services with the help of telecommunication and computers.

 EDI (Electronic Data Interchange)


 Email
 EFT (Electronic Fund Transfer)
 Digital Cash
 Electronic forum (Online application forms)
 Bulletin boards  Electronic banking
CHAPTER 17
WEB DESIGNING
1. Dine HTML.
HTML (Hyper Text Markup Language) is a language, which makes it possible to present information on
Internet.
2. Define DHTML.
It is a new HTML extension that will enable a webpage to react user input without sending request to the
web server.
OR
Dynamic HTML is a collective term for a combination of Hypertext Markup Language (HTML) tags and
options that can make Web more animated and interactive than previous versions of HTML.
Dynamic HTML can allow Web documents to look and act like desktop applications or multimedia
productions.
3. Define XML.
XML is a text-based markup language used for data interchange on the web.
OR
XML is an eXtended Markup Language for documents containing structured information. Structured
information contains both content and some indication of what role that content plays.

Three marks question:


1. Explain web-hosting. Mention different types of web-hosting.
Web hosting is a service that allows organization and individuals to post a website or webpage
on the internet.
Different types of web-hosting: -
1. Free hosting
2. Virtual or shared hosting
3. Dedicated hosting
4. Collocation hosting

2.Briefly explain any three HTML tags.


a. <big>text</big> increase the size by one
b. <small>text</small> decrease the size by one
c. <p> text</p> paragraph break after the text.
d. <b> or <i> defines bold or italic text only
3. Explain types of web scripting
Scripts are broadly of following two types:
I. Client –side Scripts
II. Server-side scripts
Client-side scripts: -
Client-side script 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. Eg: Java, VB script
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. Eg: ASP, JSP

4. Give the features of Dynamic HTML?

 An object-oriented view of a Web page and its elements


 Cascading style sheets and the layering of content
 Programming that can address all or most page elements  Dynamic fonts

5. What are the steps involved in hosting a webpage.


Steps to Host a Website:
Step1: Decide what type of website you want typically
find Typically find 2 types of websites:
(i). Static or Basic Websites: Static websites are simple websites with one or more web pages
(called HTML pages). You can build them on your computer with software like
Dreamweaver and then up load the pages to your host’s

(ii). Dynamic Websites: Dynamic websites contain information that changes, depending on the
time of day, the viewer and other factors.
Step 2: Choose Your Hosting
Server Basically, two types of
hosting platforms Linux
Hosting, Windows Hosting.
Step 3: Select Your Web Hosting Plan

 Shared Hosting:  VPS Hosting  Dedicated


Hosting:
 Cloud Hosting:
Step 4: Change Your DNS Address
After you have purchased your web hosting, you will get Name Servers (also known as Domain
Name Servers or DNS)
Step 5: Upload Your Website
You can now upload your website to your account by connecting to the server using either cPanel’s File
Manager or FTP Client (such as FileZilla) – after which your website will go live.

You might also like