IPE MARCH 2015 OOPS & JAVA 1. What IS Java byte code? A) Java Bytecode: Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode opcode is one byte in length, although some require parameters, resulting in some multi-byte instructions. 2. What is a class? A) Class: A class is a collection of objects of similar type. It is a template from which objects are created. 3. What is an array? A) Array: An array is a collection of similar type of data elements which are stored in consecutive memory locations under a common variable name. 4. What is Inheritance? A) Inheritance: Inheritance is the process by which objects of one class acquire the properties of objects of another class. Inheritance supports the concept of hierarchical classification. Inheritance provides the idea of reusability. 5. Write any four Java API Packages? A) Package java.lang java.util java.applet java.awt java.io Purpose It includes classes for primitive types, strings, math functions, threads and exceptions. Language utility classes such as vectors, hash tables, random numbers, date etc., Classes for creating and implementing applets. Includes classes for windows, buttons, list, menus and so on. Input or output support classes. 6. What is logical error? A) Logical Errors: The programmer might be using a wrong formula or the design of the program itself is wrong. Logical errors are not detected either by Java compiler or JVM. The programmer solely responsible for them. 7. What is Multitasking? A) Multitasking: It is an operating system concept in which multiple tasks are performed simultaneously. 8. What are the methods of applet class? A) A) B) C) D) E) init start stop destroy paint 9. What is AWT? A) AWT: AWT stands for Abstract Window Tool Kit. It is a portable GUI library among various operating systems for stand-alone applications. 10. What are the classes involved in event handling? A) Event handling involves four types of classes 1. Event Sources 2. Event classes 3. Event Listeners 4. Event Adapters 11. Write about main features of Java. A) Features of Java: 1. Object Oriented: In java everything is an Object. Java can be easily extended since it is based on the Object Model. 2. Platform Independent: Platform means an operating system such as windows, Unix, linux,etc., If a java program is compiled, it is compiled into platform independent byte code. This byte code can run on any platform. Hence we can say that the java is platform independent. 3. Simple: Java is designed to be easy to learn. If we understand the basic concept of OOP java would be easy to master. 4. Secure: With java’s secure feature it enables to develop virus – free, tamper – free systems. Authentication techniques are based on public – key encryption. 5. Architetural – Neutral: Java compiler generates an architecture – neutral object file format which makes the compiled code to be executable on many processors with the presence Java runtime system. 6. Portable: We may carry the java byte code to any platform. 7. Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and runtime checking. 8. Multi – threaded: With java’s multi-threaded feature it is possible to write programs that can do many tasks simultaneously. This design feature allows developers to construct smoothly running interactive applications. 9.. Interpreted: Java byte code is translated on the fly to native machine instructions and is not stored any where. The development process is more rapid and analytical since the linking is an incremental and light weigh process. 10. High Performance: With the use of Just – In – Time compilers Java enables high performance. 11. Distributed: Java is designed for the distributed environment of the internet. 12. Dynamic: Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run – time. 12. Write about various operators in Java. A) Arithmetic Operators: Arithmetic Operators are used to perform arithmetic operations on two operands. Ex: a and b are integer variables and assigned a=5 and b=3 then Operator Purpose Arithmetic Result Expression + Addition a+b 8 Subtraction a-b 2 * Multiplication a*b 15 / Division a/b 1 % Remainder after a%b 2 integer division Relational Operators: Relational Operators: There are six relational operators supported by Java language. These returns result in the form of ‘true’ or ‘false’. Ex: a, b and c are integer variables and assigned 3, 5 and 10 respectively. Operator Purpose Relational Expression Result == is Equal to c = = 10 False != is Not equal to a != b True > is Greater than a>b False < is Less than (a+b)<c True >= is Greater than or equal to a>=3 True <= is Less than or equal to b<=a False 13. Explain different data types in java. A). Java has four main primitive data types built into the language. We can also create our own data types. Integer: byte, short, int, and long. Floating Point: float and double Character: char Boolean: variable with a value of true or false. The following chart summarizes the default values for the java built in data types. Type Size in Bytes Range byte 1 byte -128 to 127 short 2 bytes -32,768 to 32,767 int 4 bytes -2,147,483,648 to 2,147,483, 647 8 bytes -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 float 4 bytes approximately ±3.40282347E+38F (6-7 significant decimal digits) Java implements IEEE 754 standard double 8 bytes approximately ±1.79769313486231570E+308 (15 significant decimal digits) char 2 byte 0 to 65,536 (unsigned) boolean not precisely defined* true or false Data Type Default Value (for fields) Range Byte 0 -127 to +128 long 14. Discuss briefly about decision – making statements in Java. A) if statement: if statement is used to control the flow of execution of statements. Syntax: if (test expression) { Statement _block; } statement x; The statement _block may be a single statement or multiple statements. If the test expression is ‘true’, the statement_block will be executed, otherwise the statement block will be skipped and the control flows to the immediately following the statement block. Ex: if (a>b) big = a; if …… else statement: The if…..else statement is an extension of the simple if statement. If the test expression is true then statements under if will be executed else statements under else will be executed. Syntax: if (test expression) { true block statements; } else { false block statements; } Ex: if (a>b) big = a; else big = b; Switch Statement: The switch statement tests the value of a given variable against a list of value and when a match is found, corresponding block of statements associated with the case will be executed. If none is matched ‘default’ block will be executed. The ‘break’ statement at the end of each block signals the end of a particular case causes an exit from the switch statement, transferring the control to the statement immediately following the switch. Syntax: switch(expression) { case value: block1; break; case value: block2; break; case value: block3; break; --------------------------------------- default: default block; break; } 15. Write a program to find factorial of a given number. A) //to find the factorial by using while loop import java.util.Scanner; class Factoria{ public static void main(String args[]){ int i,f=1,n; System.out.println("Enter an Integer:"); Scanner in = new Scanner(System.in); n = in.nextInt(); i = 1; while(i<=n){ f*=i; ++i; } System.out.println("Factorial of"+n+"is" +f); }} Output: Enter an Integer: 5 Factorial of 5 is 120 16. Explain the polymorphism with an example. A) Polymorphism: Polymorphism means the ability to take more than one form is called Polymorphism. We can store all the objects of extended classes in to variable of parent class. The only possible way to access an object is through a reference variable. A reference variable can be only one type. Once declared the type of reference variable cannot be changed. The reference variable can be reassigned to other objects provided that it is not declared final. The type of the reference variable would determine the methods that it can invoke on the object. A reference variable can refer to any object of its declared type or any subtype of its declared type. A reference variable can be declared as a class or interface type. Ex: class Box{ int w,h; void info( ){ System.out.println("This is a simple box"); System.out.println("width = "+w+"height="+h); }} class woodenBox extends Box{ int life; void info( ){ System.out.println("This is a wooden box"); }} class SteelBox extends Box{ int wg; void info( ){ System.out.println("This is a steel box"); }} class LargewoodenBox extends woodenBox{ void info( ){ System.out.println("This is a Huge wooden Box"); }} class BoxDemo{ public static void main(String ary[ ]){ Box x; Box b1= new Box( ); woodenBox wb=new woodenBox( ); SteelBox s1=new SteelBox( ); LargewoodenBox p1=new LargewoodenBox( ); b1.info( ); wb.info( ); s1.info( ); p1.info( ); }} Output: This is a simplebox Width=0 hieght=0 This is a wooden box This is a steel box This is a Huge wooden Box 17. Discuss briefly about Packages and Interfaces. A) Interfaces Vs Packages A package is just a mechanism for grouping objects, it is very similar to grouping items within a folder or directory on a file system. A class is found with in a package, but this does not have an impact on the class behavior. An Interface, however, is a.java file that is used (implemented) by another class to tell the outside world that it conforms to a certain specification. Interfaces have more in common with abstract classes than they do with packages. An Interface, by definition, cannot have any implemented methods. An abstract class can define some methods and leave some methods to implemented by a subclass. A class can implement many interfaces, but can only extend one (abstract) class. 18. Write about methods of Applet Class. A) Methods Of Applet Class (Life Cycle of an applet): Four methods give us the framework on which we build an applet. 1. init : This method is intended for whatever initialization is needed for our applet. It is called after the param tags inside the applet tag have been processed. 2. Start: This method is automatically called after the browser calls the init method. It is also called whenever the user returns to the page containing the applet after having gone off to other pages. 3. Stop: This method is automatically called when the user moves off the page on which the applet sits. It can, therefore, be called repeatedly in the same applet. 4. Destroy: This method is only called when the browser shuts down normally 5. Paint: Invoked immediately after the start() method and also any time the applet needs to repaint itself in the browser. The paint() method is actually inherited from the java awt. RDBMS 1. What is DBMS? A) A database management system (DBMS) can be defined as a collection of software packages for processing the database. 2. What is a Domain? A) Domain: Domain is a pool of values of a specific attribute. Separate domains for separate attributes. 3. What is Tuple? A. Tuple is a row(record) of a table . 4. What are the Formal Query Languages? A. Formal Query Languages are formal in the sense that they are lack of ‘syntactic behavior ‘of commercial query languages. Some of the formal Query Languages are listed below: - The Relational Algebra - Tuple Relational Calculus - Domain Relational Calculus 5. What is Degree of Table in Relational Model? A) Number of attributes is called degree. 6. Write the Internal Datatypes in SQL. A) varchar , varchar2 , numb, long, date ,etc 7. What is Sub – query? A. Nesting of queries, one within another, is termed as subquery. 8. Wha is a Database Trigger? A) Database Trigger: A database trigger is a stored procedure that will be executed when an event is occurred i.e., insert, update, delete statement is issued against the associated table. 9. Define system and Sub-system. A. System: System is an orderly grouping of interdependent components linked together to approach a Specific object or goal. Ex: Railway reservation system , Net banking system. Sub System: One of the number of component parts of a system. All the subsystems must function together in an integrated manner for the system to operate as designed. 10. Define Data Dictionary? A. Data Dictionary: Data Dictionary is a repository that contains descriptions of all data objects produced by the software. 11. Explain different Data Models. A. Different data models are 1. Object based data models 2. Record – based data models 3. Physical data models 1. Object base data models: Object-based logical models are used in describing data at logical and view levels. They are characterized by the fact they provide flexible structuring capabilities and allow data constraints to be specified explicitly. There are many different data models, some of them are i. The Entity-relationship model ii. The Object-oriented model iii. The semantic data model iv. The Functional data model 2. Record based data models: In Record based data models; the database is structured in fixed formats records of several types. Each record defines fixed number of fields (attributes) and each field is fixed length. These models are used to specify the overall logical structure of the database and are used in describing the database at conceptual level. The three widely accepted record – based data models are: a) Relational model b) Network model c) Hierarchical model 3. Physical data models: Physical data model are used to describe data at the lowest level. In contrast to logical data models, there are few number of physical data models which are in use. Very few physical data models have been proposed so far. Two of these well known models are the unifying model and the frame memory model. 12. What are the functions of DBA? Explain. A) 1. Schema definition 2. Storage structure and Access method definition 3. Schema physical organization and modification 4. Granting of authorization for data access 5. Routine maintenance 1. Schema Definition: The DBA creates the original database schema by executing a set of definition statements in the DDL. 2. Storage structure and Access method definition: DBA will decide the actual storage structure and different access methodologies for the database. 3. Schema physical organization and modification: The DBA carries out the changes to the schema and physical organization to reflect the changing needs of the organization or to alter the physical organization to improve the performance. 4. Granting of authorization for data access: By granting different types of authorization, the database administrator can regulate which of the database various can access. 5. Routine maintenance: DBA is the final authority to regulate daily activities. 13. Explain mapping constraints with diagram. A) There are 4 types of mapping constraints. 1. ONE – to – ONE relationship 2. MANY – to – ONE relationship 3. ONE – to – MANY relationship 4. MANY – to – MANY relationship 1. ONE – to – ONE relationship: An entity in A is associated with at most one entity in B , An entity in B is also associated with at most one entity in A. Example : Relationship between the entities principal and college. i.e., Principals can lead a single college and a principal can have only one college 2. Many – to – One relationship: An entity set in A is associated with at most one entity in B, An entity in B however can be associated with any number of entities in A. Example: Relationship between the entities Districts and state .i.e. many districts belong to a single state but many states cannot belong to single district. 3. ONE – to - MANY relationship: An entity set A is associated with any number of entities in B. An entity in B, however can be associated with at most one entity in A. Example: Relationship between the entities class and student i.e., a class can have many students but a student cannot be in more than one class at a time. 4. MANY – to – MANY relationship: An entity set A is associated with any number of entities in B and an entity set in B is associated with any number of entities in A. Example: Relationship between the Entities College and course .i.e. a college can have many courses and course can be offered by many colleges. 14. What is Key? Write about different types of Keys. A) Key: A key allows us to identify a set of attributes in an entity . Keys also help uniquely identify relationships, and thus distinguish relationships from each other. The keys can be categorized in to 1. Super Key: A Super key is a set of one or more attributes that, taken collectively; allow us to identify uniquely an entity in the entity set. For example, the ‘student_id’ attribute of the entity set student is sufficient to distinguish one student entity from another. Thus, ‘student_id’ is a super key 2. Candidate Key: A super key with minimal values is called a candidate key. A super key that does not contain a subset of attributes, that is itself super key. 3. Primary key: The Primary key of a relational data base table is a column name which uniquely identifies each record in the table. It cannot contain NULL entries. 4. Secondary key :- An attribute ( or ) Combination of attributes used strictly for data retrieval purposes. 5. Foreign key :- An attribute or Combination of attributes in one table whose values must either match the primary key in another table or be NULL. 15. What are CODD rules in Relational Model. A) CODD rules Edgar F. Codd, proposed thirteen rules (numbered zero to twelve) and said that if a Database Management System meets these rules, it can be called as a Relational Database Management System. These rules are called as Codd’s12 rules. Hardly any commercial product follows all. 0. Foundation Rule A RDBMS must manage its stored data using only its relational capabilities. 1. Information Rule All information in the database should be represented in one and only one way - as values in a table. 2. Guaranteed Access Rule Each and every datum (atomic value) is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name. 3. Systematic Treatment of Null Values Null values (distinct from empty character string or a string of blank characters and distinct from zero or any other number) are supported in the fully relational DBMS for representing missing information in a systematic way, independent of data type. 4. Dynamic On-line Catalog Based on the Relational Model The database description is represented at the logical level in the same way as ordinary data, so authorized users can apply the same relational language to its interrogation as they apply to regular data. 5. Comprehensive Data Sublanguage Rule A relational system may support several languages and various modes of terminal use. However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and whose ability to support all of the following is comprehensible: a. data definition b. view definition c. data manipulation (interactive and by program) d. integrity constraints e. authorization f. transaction boundaries (begin, commit, and rollback). 6. View Updating Rule All views that are theoretically updateable are also updateable by the system. 7. High-level INSERT, UPDATE, and DELETE The capability of handling a base relation or a derived relation as a single operand applies nor only to the retrieval of data but also to the insertion, update, and deletion of data. 8. Physical Data Independence Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representation or access methods. 9. Logical Data Independence Application programs and terminal activities remain logically unimpaired when information preserving changes of any kind that theoretically permit unimpairment are made to the base tables. 10. Integrity Independence Integrity constraints specific to a particular relational database must be definable in the relational data sublanguage and storable in the catalog, not in the application programs. 11. Distribution Independence The data manipulation sublanguage of a relational DBMS must enable application programs and terminal activities to remain logically unimpaired whether and whenever data are physically centralized or distributed. 12. Non - subversion Rule If a relational system has or supports a low-level (single-record-at-a-time) language, that low-level language cannot be used to subvert or bypass the integrity rules or constraints expressed in the higher-level (multiple-records-at-a-time) relational language. 16. Explain DML Commands with example. A. DML Commands: insert , select , delete and update 1. insert: The INSERT INTO Statement is used to add new rows of data to a table in the database. Syntax: Insert into <table name> values (value1 , value2 , value3 , ..valueN); Example: Following statements would create three records in student table: insert into student values(101 , ‘chanukya’); insert into student values(102 , ‘kavya’); insert into student values(101 , ‘satish’); 2.select: SELECT statement is used to fetch the data from a database table which returns data in the form of result table. These result tables are called result-sets. Syntax: Select column1 , column2 , column from <table name>; Here, column1, column2...are the fields of a table whose values you want to fetch. If you want to fetch all the fields available in the field, then you can use the following syntax: Select * from <table_name> Example1: select * from student; Then the output will be Stno stname ------- --------- 101 chanukya 102 kavya 103 satish Example2: select stname from student; Stname --------chanukya kavya satish Example3: select * from student where stno >=102 ; Then the output will be Stno stname ------- --------- 102 kavya 103 satish 3. update: The UPDATE command is used to modify the existing records in a table. You can use WHERE clause with UPDATE query to update selected rows otherwise all the rows would be affected. Syntax: UPDATE < table name > SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition]; Example: Consider the student table having the following records: Sql>select * from student; Stno ------- stname --------- 101 chanukya 102 kavya 103 satish sql> update student set stname = ‘ratnam’ where stno = 101; Sql>select * from student; then the output will be as follows Stno ------- stname --------- 101 ratnam 102 kavya 103 satish 4.delete: DELETE command is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted. Syntax: Delete from <table name> where [condition] ; Example: Sql>select * from student; then the output will be as follows Stno stname ------- --------- 101 ratnam 102 kavya 103 satish Sql>delete from student where stno = 101; Sql> select * from student; The output will be as follows Stno stname ------- --------- 102 kavya 103 satish 17. Explain control structure in PL / SQL. A) PL/SQL can process the data using flow of control statements. The flow of control can be classified into three categories Conditional Controls Iterative Controls Sequential Controls Conditional Controls: Conditional Statements are three types, those are A. if statements B. if then else statements C. if then else if statements. A) if statement: Sequence of statements can be executed based on some condition using the if statement. Syntax: if <condition> then Statements; end if; B) if then else : Sequence of statements can be executed based on some condition using the if statement. An else clause in the ‘if then else’ statement defines what is to be done if the condition is false or null. Syntax: if <condition> then Statements; else Statement; end if; Iterative Controls: These statements are used to execute a particular statement for repeated number of times. A. Simple Loop B. for Loop C. while Loop A) Simple Loop: Simple “loop” should be placed before the first statement in the sequence and the keyword “end loop” after the last statement. Syntax: loop Statements; end loop; B) for Loop: The “for” loop will be executed for repeated number of times by automatically declaring loop variable and also loop variable is always incremented by 1. Syntax: for <variable> in [reverse] start …… end (star=lower bound, end= upper bound) loop Statements; end loop; C) while Loop: In while loop the keyword “loop” has to be placed before the first statement in the sequence statements to be repeated, while the keyword “end loop” will be placed immediately after the last statement. Syntax: while<condition> loop Statements; end loop; Sequential Controls: GOTO: GOTO statement change of the flow of control within PL/SQL block. Syntax: GOTO<code_block_name>; 18. Explain different stages of System Development Life cycle (SDLC). A. A) System Development Life Cycle : The stages involved during System Development Life Cycle are :: 1. Recognition of need 2. Feasibility study 3. Analysis 4. Design 5. Implementation 6. Post implementation and maintenance 1. Recognition of need: This gives a clearer picture of what actually the existing system is. The preliminary investigation must define the scope of the project and the perceived problems, opportunities and directives that triggered the project. 2. Feasibility Study: The goal of feasibility study is to evaluate alternative system and to purpose the most feasible and desirable system for development. In the process of feasibility study, the cost and benefits are estimated with greater accuracy. If cost and benefit can be quantified, they are tangible ; if not , they are called intangible. 3. System Analysis: System analysis is an in-depth study of end user information needs that produces functional requirements that are used as the basis for the design of a new information system. 4. System Design: System design can be viewed as the design of user interface, data, process and system specification . 5. System Implementation: Implementation is the stage where theory is converted into practical. The implementation is a vital step in ensuring the success of new systems. Even a well designed system can fail if it is not properly implemented. 6. Post Implementation and Maintenance: Once a system is fully implemented and being operated by end user, the maintenance function begins. Systems maintenance is the monitoring, evaluating and modifying of operational information system to make desirable or necessary improvements. DCCN 1. What is data communication? A) Data communication is the transmission of electronic data over some media. The media may be cables, microwaves or fiber optics. Types of data communications are - Point to point communication - Point to multipoint communication 2. List various types of Computer Networks. A) Different types of computer networks Depending upon the geographical area covered by a network, it is classified as: – Local Area Network (LAN) – Metropolitan Area Network (MAN) – Wide Area Network (WAN) – Personal Area Network (PAN) 3. Expand LAN, WAN, BBN, GAN. A) LAN : Local Area Network WAN: Wide Area Network BBN: Back Bone Networks GAN: Global Area Networks 4. What is File Server? A) File server – A file server is a computer attached to a network that has the primary purpose for sharing of files (such as documents, sound files, photographs, movies, images, databases, etc.) that can be accessed by the clients. 5. What is FTP? A. File Transfer Protocol, or FTP, is a protocol used for transferring files from one computer to another - typically from your computer to a web server. 6. What is Hacking? A) Hacking: Hacking is an activity that is used by a hacker to steal the information from any of the device or computer system. Also a hacker can use the system to work as a server to route the information for the own purpose. Hackers can use the contact information of system and send spam emails to that email ids. 7. Write any three advantages of HTML. A) 1. First advantage it is widely used. 2. Every web browser supports HTML language. 3. Easy to learn and use. 4. It is by default in every windows so you don't need to purchase extra software. 8. What is Table Tag in HTML? A) Table Tag The <table> tag defines an HTML table. An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements. The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell. The attributes used in <table> tag are “align=left, center or right”, border and bgcolor. The attributes used in <tr> tag are “align=left, center or right”, colspan and rowspan. For example, <td colspan=2> will take up two columns and <td rowspan=2> will take up two rows. 9. Write advantages of DHTML? A. Advantages: Dynamic content, which allows the user to dynamically change Web page content Dynamic positioning of Web page elements. Dynamic style, which allows the user to change the Web page’s color, font, size or content. 10. What is DOM? A) DOM: DOM is "a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure, and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented stage. 11. Write about Transmission modes. A) Types of Transmission Modes There are three ways for transmitting data from one point to another 1. Simplex: 1. In simplex mode the communication can take place only in one direction. The receiver receives the signal from the transmitting device. This mode of flow of information is Unidirectional. Example: Radio, T.V., Pager transmission. 2. Half-duplex: In half-duplex mode the communication channel is used in both directions, but only in one direction at a time. Thus a half-duplex line can alternately send and receive data. Example is the wireless communication. 3. Full-duplex: In full duplex the communication channel is used in both directions at the same time. Use of full-duplex line improves the efficiency as the line turn-around time required in half-duplex arrangement is eliminated. Example of this mode of transmission is the telephone line. 12. Explain different types Computer Networks. A) Different types of computer networks Depending upon the geographical area covered by a network, it is classified as: – Local Area Network (LAN) – Metropolitan Area Network (MAN) – Wide Area Network (WAN) – Personal Area Network (PAN) LAN(Local Area Network): A LAN is a network that is used for communicating among computer devices, usually within an office building or home. Is limited in size, typically spanning a few hundred meters, and no more than a mile • Is fast, with speeds from 10 Mbps to 10 Gbps • Requires little wiring, typically a single cable connecting to each device • Has lower cost compared to MAN’s or WAN’s • MAN(Metropolitan Area Network): • A MAN is a large computer network that usually spans a city or a large campus. • A MAN is optimized for a larger geographical area than a LAN, ranging from several blocks of buildings to entire cities. • A MAN might be owned and operated by a single organization, but it usually will be used by many individuals and organizations. • A MAN often acts as a high speed network to allow sharing of regional resources. • A MAN typically covers an area of between 5 and 50 km diameter. • Examples of MAN: Telephone company network that provides a high speed DSL to customers and cable TV network. WAN( Wide Area Network): • WAN covers a large geographic area such as country, continent or even whole of the world. • A WAN is two or more LANs connected together. To cover great distances, WANs may transmit data over leased high-speed phone lines or wireless links such as satellites. • Multiple LANs can be connected together using devices such as bridges, routers, or gateways, which enable them to share data. • The world's most popular WAN is the Internet. PAN(Personal Area Network): • A PAN is a network that is used for communicating among computers and computer devices (including telephones) in close proximity of around a few meters within a room • It can be used for communicating between the devices themselves, or for connecting to a larger network such as the internet. • PAN’s can be wired or wireless • A personal area network (PAN) is a computer network used for communication among computer devices, including telephones and personal digital assistants, in proximity to an individual's body. • The devices may or may not belong to the person in question. The reach of a PAN is typically a few meters. 13. Explain any three Network topologies in detail. Diagram Kind of Topology Description, Advantages, and Disadvantages Description: Ring Devices are connected from one to another to form a ring shape. Each host is connected to the next and the last node is connected to the first. A data token1 is used to grant permission for each computer to communicate. Advantages: Easy to install and wire. Because every computer is given equal access to the token, no one computer can monopolize the network. Disadvantages: Requires more cable than a bus topology. If one computer fails it can affect the whole network. It is difficult to identify the problem if the entire network shuts down. Description: All hosts are connected to the backbone cable in a linear2 fashion. Advantages: Bus Easy to connect a computer or peripheral. Requires less cable length than a star topology. Disadvantages: If there is a break in the backbone cable, the entire network shuts down. Both ends of the backbone cable require terminators. It is difficult to identify the problem if the entire network shuts down. Description: All hosts are connected to a single point of concentration. Usually uses a hub3 or switch4 as a center node. Range limits are about 100 meters from the hub Data on a star network passes through the hub or concentrator before continuing to its destination. Advantages: Star It is easy to modify and add new computers to a star network without disturbing the rest of the network. If one node or workstation (beside the middle node) goes down, the rest of the network will still be functional. The center of a star network is a good place to figure out where the network faults are located. You can use several cable types in the same network if the hub you have can handle multiple cable types. Disadvantages: Requires more cable than a bus topology. If the middle node goes down , then the entire network goes down. It is more expensive than because all cables must be connected to one central point. Description: One "root" node connects to other nodes, which in turn connect to other nodes, forming a tree structure. Information from the root node may have to pass through other nodes to reach the end nodes. Advantages: • Point-to-point wiring for individual segments. • Supported by several hardware and software vendors. Tree • All the computers have access to the larger and their immediate networks. Disadvantages: • Overall length of each segment is limited by the type of cabling used. • If the backbone line breaks, the entire segment goes down. • More difficult to configure and wire than other topologies. Description: Each host is connected to all the other hosts. Advantages: Mesh Increased reliability since there are multiple paths for each node to take. Increased speed since shortcuts have been created by add more cables/links. Disadvantages: The cost of cabling all the hosts together is expensive and time consuming. 14. Discuss about Routers and Gateways. A. Router: A Router is a device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP's network. Router reduces network traffic by using routing table. Gateway: A gateway is a network element that acts as an entrance point to another network. For example an access gateway is a gateway between telephony network and other network such as internet. LANs may have component called gateways, which assists in transferring from one LAN to another LAN. A gateway is generally a work station or server. It is a two-way path between networks. It is used to connect different types of networks. Gateway is a work station by which we can make our connection between external network and internal network. Gateway belongs to transport layer and application layer of the OSI model. Gateways also connect the two networks even if the protocols are different. So protocol conversion is also done by gateways 15. Explain various Web browsers. A) Web Browsers: 1. Internet Explorer It was developed by Microsoft in 1994 and released in 1995 as a supportive package to Microsoft Windows line of operating systems. According to statistics, its usage share from 1999 to 2003-04 was around 95%. Microsoft occasionally releases updates for the previous versions of IE, which have some enhanced capabilities. IE has come up a preview release of Internet Explorer 11. Features: There are regular Microsoft updates that IE supports. Favicon allows an image to be used as a bookmark. It supports Integrated Windows Authentication. It’s icon is as follows. 2. Mozilla Firefox It is owned by Mozilla Corporation and was the result of an experimentation. 'Mozilla Firefox' was officially announced in February 2004. It was earlier named Phoenix, Firebird, and eventually Firefox. It is the second-most famous browser after Internet Explorer, as there were around 100 million downloads within a year of its release. Until November 2008, 700 million downloads were recorded. Features: As it is an open source software, it allows everyone to access the code. It supports tabbed browsing that allows the user to open multiple sites in a single window. Session storage is also an important feature of Firefox, which allows the user to regain access to the open tabs after he has closed the browser window. It’s icon is as follows. 3. Google Chrome This web browser was developed by Google. Its beta and commercial versions were released in September 2008 for Microsoft Windows. Features: The main standout feature is the malware and phishing warning that the browser suggests when the user wants to browse a site. Also, there is a user tracking option available with Chrome. It’s icon is as follows. 16. Write the structure of HTML program. A. Structure of an HTML Program. In every HTML program has a rigid structure. The entire web page is enclosed within <HTML> </HTML> tags. Within these tags two separate sections are created using the <HEAD> </HEAD> tags and the <BODY> </BODY> tags. These sections are described below. 1. < Head> tag Information placed in this section is essential to the inner workings of the document and has nothing to do with the content of the document. With the exception of information contained within the <TITLE> </TITLE> tags, all information placed within the <HEAD> </HEAD> tags is not displayed in the browser. The HTML tags used to indicate the start and end of the head section are: <HEAD> <TITLE> </TITLE> </HEAD> The <TITLE> tag sets the title of the document which will be displayed in the title bar of the browser window. 2. < Body> tag The tags used to indicate the start and end of the main body of textual information are: <BODY> </BODY> Page defaults like background color, text color, font size, font weight and so on can be specified as attributes of the <BODY> tag. The attributes that the <BODY> tag takes are: bgcolor, background, text, etc., Example <html> <head> <title> First Page </title> </head> <body> This is My First Web Page </body> </html> 17. Explain various types of lists used in HTML. A. LISTS: Lists are used to list out items, subjects or menu in the form of a list. HTML gives you three different types of lists. <ul> - An unordered list. This will list items using bullets <ol> - A ordered list. This will use different schemes of numbers to list your items <dl> - A definition list. This is arrange your items in the same way as they are arranged in a dictionary. HTML Unordered Lists: This list is created by using <ul> tag. Each item in the list is marked with a bullet. The bullet itself comes in three styles: squares, discs, and circles. The default bullet displayed by most web browsers is the traditional full disc. Example: <html> <body> <center> <h2>II YEAR CSE PAPERS</h2> </center> <ul> <li>GFC</li> <li>ENGLISH</li> <li>OOPS&JAVA</li> <li>RDBMS</li> <li>DCCN</li> </ul> </body> </html> This will produce following result: II YEAR CSE PAPERS GFC ENGLISH OOPS&JAVA RDBMS DCCN You can use type attribute to specify the type of bullet you like. By default its is a disc. Following are the possible way: <ul type="square"> <ul type="disc"> <ul type="circle"> 2.HTML Ordered Lists: This list is created by using <ol> tag. Each item in the list is marked with a number. By default The numbering starts from one and is incremented by one. example: <html> <body> <center> <h2>II YEAR CSE PAPERS</h2> </center> <ol> <li>GFC</li> <li>ENGLISH</li> <li>OOPS&JAVA</li> <li>RDBMS</li> <li>DCCN</li> </ol> </body> </html> This will produce following result: II YEAR CSE PAPERS 1. 2. 3. 4. 5. GFC ENGLISH OOPS&JAVA RDBMS DCCN You can use type attribute to specify the type of numbers you like. By default its is a generic numbers. Following are the other possible way: <ol type="I"> - Upper-Case Numerals. <ol type="i"> - Lower-Case Numerals. <ol type="a"> - Lower-Case Letters. <ol type="A"> - Upper-Case Letters. 3.HTML Definition Lists: Definition List makes use of following three tags. <dl> - Defines the start of the list <dt> - A term <dd> - Term definition </dl> - Defines the end of the list Example: <html> <body> <dl> <dt><b>LAN</b></dt> <dd>LAN stands for Local Area Network</dd> <dt><b>WAN</b></dt> <dd>WAN stands for Wide Area Network</dd> </dl> </body> </html> > This will produce following result: LAN LAN stands for Local Area Network WAN WAN stands for Wide Area Network 18. Discuss briefly about CSS. A. Introduction to CSS CSS stands for Cascading Style Sheets. It is a way to divide the content from the layout on web pages. A CSS (cascading style sheet) file allows you to separate your web sites HTML content from it’s style. As always you use your HTML file to arrange the content, but all of the presentation (fonts, colors, background, borders, text formatting, link effects & so on…) are accomplished within a CSS. Advantages of CSS: 1. Define the look of your pages in one place rather than repeating yourself over and over again throughout your site. 2. Easily change the look of your pages even after they're created. Since the styles are defined in one place you can change the look of the entire site at once. 3. Define font sizes and similar attributes with the same accuracy as you have with a word processor - not being limited to just the seven different font sizes defined in HTML. 4. Position the content of your pages with pixel precision. 5. Redefine entire HTML tags. Say for example, if you wanted the bold tag to be red using a special font - this can be done easily with CSS. 6. Define customized styles for links - such as getting rid of the underline. 7. Define layers that can be positioned on top of each other (often used for menus that pop up). The one disadvantage is: 1. These will only work on version 4 browsers or newer. However, more than 95% of all browsers live up to that. 1. Explain about CSS selector. CSS Selectors CSS Selectors are the names that you give to your different styles. In the style definition you define how each selector should work (font, color etc.).Then, in the body of your pages, you refer to these selectors to activate the styles. Program <HTML> <HEAD> <style type="text/css"> b.headline { color:red; font-size:22px; font-family:arial; text-decoration:underline } </style> </HEAD> <BODY> <b>This is normal bold</b><br> <b class="headline">This is headline style bold</b> </BODY> </HTML> Output