GHPS – Punjabi Bagh

PRE MOCK 1 Examination
Class – XII
Subject – Informatics Practices

Time : 3 Hours M.M. 70 M

SECTION A

Q1. (a) Bus Topology is the simplest ofnetwork topologies. In this type of topology, all the nodes (computers as well as servers) are connected to the single cable (called bus), by the help of interface connectors. This central cable is the backbone of the network and is known as Bus (thus the name). Every workstation communicates with the other device through this Bus.

Advantages (benefits) of Linear Bus Topology


1)It is easy to set-up and extend bus network.
2)Cable length required for this topology is the least compared to other networks.
3)Bus topology costs very less.
4)Linear Bus network is mostly used in small networks. Good for LAN.

Disadvantages (Drawbacks) of Linear Bus Topology


1)There is a limit on central cable length and number of nodes that can be connected.
2)Dependency on central cable in this topology has its disadvantages.If the main cable (i.e. bus ) encounters some problem, whole network breaks down.
3)Proper termination is required to dump signals. Use of terminators is must.
4)It is difficult to detect and troubleshoot fault at individual station.
5)Maintenance costs can get higher with time.
6)Efficiency of Bus network reduces, as the number of devices connected to it increases.
7)It is not suitable for networks with heavy traffic.
8)Security is very low because all the computers receive the sent signal from the source.


Star topology, all the components of network are connected to the central device called “hub” which may be a hub, a router or a switch. UnlikeBus topology(discussed earlier), where nodes were connected to central cable, here all the workstations are connected to central device with a point-to-point connection. So it can be said that every computer is indirectly connected to every other node by the help of “hub”.

Advantages of Star Topology

1)As compared to Bus topology it gives far much better performance, signals don’t necessarily get transmitted to all the workstations. A sent signal reaches the intended destination after passing through no more than 3-4 devices and 2-3 links. Performance of the network is dependent on the capacity of central hub.
2)Easy to connect new nodes or devices. In star topology new nodes can be added easily without affecting rest of the network. Similarly components can also be removed easily.
3)Centralized management. It helps in monitoring the network.
4)Failure of one node or link doesn’t affect the rest of network. At the same time its easy to detect the failure and troubleshoot it.

Disadvantages of Star Topology

1) Too much dependency on central device has its own drawbacks. If it fails whole network goes down.
2) The use of hub, a router or a switch as central device increases the overall cost of the network.
3) Performance and as well number of nodes which can be added in such topology is depended on capacity of central device.

(Any two advantages and Disadvantages)

(b)

  1. Coaxial cable,,is a type ofcablethat has an inner conductor surrounded by a tubular insulating layer, surrounded by a tubular conducting shield. Many coaxial cables also have an insulating outer sheath or jacket. Coaxial cable differs from othershielded cableused for carrying lower-frequency signals, such asaudio signals, in that the dimensions of the cable are controlled to give a precise, constant conductor spacing, which is needed for it to function efficiently as aradio frequencytransmission line.
  2. Twisted paircabling is a type of wiring in which two conductors of a singlecircuitare twisted together for the purposes of canceling out electromagnetic interference(EMI) from external sources; for instance,electromagnetic radiationfrom unshielded twisted pair (UTP) cables, andcrosstalkbetween neighboring pairs.

The two wires carry equal and opposite signals and the destination detects the difference between the two. This is known asdifferential modetransmission. Noise sources introduce signals into the wires by coupling of electric or magnetic fields and tend to couple to both wires equally. The noise thus produces a common-mode signal which is canceled at the receiver when the difference signal is taken.

  1. Anoptical fiber cableis acablecontaining one or moreoptical fibersthat are used to carry light. The optical fiber elements are typically individually coated with plastic layers and contained in a protective tube suitable for the environment where the cable will be deployed. Different types of cable are used for different applications, for example long distancetelecommunication, or providing a high-speed data connection between different parts of a building.

(1/2 marks for names and 1 ½ for correct explanation of any one)

(c)

1.  ASCII

2.  EBDIC

3.  ISCII standard.

4.  UNICODE

(1 mark for each correct option)

(d)

  1. HUB - A common connection point fordevicesin anetwork. Hubs are commonly used to connectsegmentsof aLAN. A hub contains multipleports. When apacketarrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

In a hub, a frame is passed along or "broadcast" to every one of its ports. It doesn't matter that the frame is only destined for one port. The hub has no way of distinguishing which port a frame should be sent to. Passing it along to every port ensures that it will reach its intended destination. This places a lot of traffic on the network and can lead to poor network response times.

2.  GATEWAY - Gateway is arouteror aproxy serverthat routes between networks

Gateway Rule - Gateway should belong to same subnet to which your PC belongs

In acommunications network, a networknodeequipped for interfacing with another network that uses differentprotocols.

A gateway may contain devices such as protocol translators,impedance matchingdevices, rate converters,faultisolators, orsignal translators as necessary to providesysteminteroperability. It also requires the establishment of mutually acceptable administrative procedures between both networks.

A protocol translation/mapping gateway interconnects networks with different network protocol technologies by performing the required protocol conversions.

Loosely, acomputerorcomputer programconfigured to perform the tasks of a gateway. For a specific case, seedefault gateway.

Gateways, also calledprotocol converters, can operate at any network layer. The activities of a gateway are more complex than that of therouterorswitchas it communicates using more than one protocol

(e)  Free software - iscomputer softwarethat gives users the freedom to run the software for any purpose as well as to study, modify, and distribute the original software and the adapted versions. The rights to study and modify free software imply unfettered access to itssource code.

The essential difference, slightly oversimplified, is that Free Software generally requires that, if you modify and/or incorporate it into another body of work, theentire result must also be distributed as Free Software,and you are forbidden to further restrict the ability of any "downstream" users from modifying, using, or redistributing the software with the same rights that were given to you.

Free source in the sense: Which is free with free laws applicable once you modify it also should also be shared to world with same laws! And its code if any can also be all of us!

Open source in the sense: We can see the actual application for our daily usage, but cannot use it as it is ours means that we cannot modify its code since it is copyrighted to the distributor!

(1 mark for correct definition and 1 mark for difference)

Q2. (a) java.awt.event Package

Or

Java.awt.event.ActionListener.

This package defines classes and interfaces used for event handling in the AWT. (1)

(b) (iii) a character array (1)

.getPassword()returns a char[], and char[]'s aren't equal to Strings.

Explanation

The reason getPassword doesn't return a String is because of the way Java handles Strings -- it can store them in the String pool, allowing Strings to hang out in the program longer than you'd expect, and making the Strings potentially retrievable by malware -- something you don't want to have happen to a password. It's much safer to work with char arrays.

(c) Inheritance in javais a mechanism in which one object acquires all the properties and

behaviors of parent object.

The idea behind inheritance in java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of parent class, and you can add new methods and fields also.

Inheritance represents theIS-A relationship, also known as Parent-Child relationship.

Why use Inheritance?

·  For Method Overriding (So Runtime Polymorphism).

·  For Code Reusability.

There exists basically three types ofinheritance.

1.Insingle inheritance, one class extends one class only. Inmultilevel inheritance, the ladder of single inheritance increases.
2.Inmultiple inheritance, one class directly extends more than one class.
3.Inhierarchical inheritanceone class is extended by more than one class. (2)

(d) Markup languages are designed for the processing, definition and presentation oftext.

Thelanguagespecifiescodefor formatting, both the layout and style, within atext file.

The code used to specify the formatting are calledtags.HTML is a an example of a widely

known and used markup language. (2)

!DOCTYPEhtml
html
body
h1My First Heading/h1
pMy first paragraph./p
/body
/html

(e)

a) OBDC is for Microsoft and JDBC is for Java applications.

b) ODBC can’t be directly used with Java because it uses a C interface.

c) ODBC makes use of pointers which have been removed totally from Java.

d) ODBC mixes simple and advanced features together and has complex options for

simple queries. But JDBC is designed to keep things simple while allowing advanced

capabilities when required.

e) ODBC requires manual installation of the ODBC driver manager and driver on all client machines.

JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms.

f) JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC. (any valid difference 2 points) (2)

(f) Aclassis the blueprint from which individual objects are created. (1)

Aclass--the basic building block of an object-oriented language such as Java--is a template that describes the data and behavior associated withinstancesof that class.

Constructors are used to initialize the instances of your classes. You use a constructor to create new objects often with parameters specifying the initial state or other important information about the object

class contains constructorsthat are invoked to create objects from the class blueprint. Constructor declarations look like method declarations—except that they use the name of the class and have no return type. For example, Bicycle has one constructor: (1)

public Bicycle(int startCadence, int startSpeed, int startGear) {

gear = startGear;

cadence = startCadence;

speed = startSpeed;

}

To create a new Bicycle object calledmyBike, a constructor is called by the new operator:

Bicycle myBike = new Bicycle(30, 0, 8);

new Bicycle(30, 0, 8)creates space in memory for the object and initializes its fields.

Although Bicycle only has one constructor, it could have others, including a no-argument constructor:

public Bicycle() {

gear = 1;

cadence = 10;

speed = 0;

}

Bicycle yourBike = new Bicycle();invokes the no-argument constructor to create a new Bicycle object called yourBike.

Java class example:

ClassStock{

Publiccommodity;

Public price;

Public void buy (int no_ofcommodity) {}

Public boolean sale () {}

}

(any good definition of class and constructor fetches 2 marks)

Q3. (a) ACID (atomicity, consistency, isolation, and durability) is an acronym and mnemonicdevice for learning and remembering the four primary attributes ensured to any transaction by atransactionmanager (which is also called a transaction monitor). These attributes are:

(i)  Atomicity. In a transaction involving two or more discrete pieces of information, either all of the pieces are committed or none are.

(ii)  Consistency. A transaction either creates a new and valid state of data, or, if any failure occurs, returns all data to its state before the transaction was started.

(iii)  Isolation. A transaction in process and not yet committed must remain isolated from any other transaction.

(iv)  Durability. Committed data is saved by the system such that, even in the event of a failure and system restart, the data is available in its correct state (2)

(b) Constraints in MySQL

The MySQL DBMS offers a useful suite of methods to ensure data consistency.

Primary key constraints forbid duplicate values in one or more columns of a table. Foreign key constraints (using the InnoDB storage engine) ensure consistency of tuple (row) references across tables. Table check constraints are not supported, nor are general SQL assertions.

I.  Keys

A primary key is a set of attributes whose values should be unique within a table. A table cannot have more than one set of attributes specified as the primary key, and the columns of a primary key cannot contain null values. Primary keys are optional and can be defined inCREATE TABLEorALTER TABLEstatements.

II.  Non-primary candidate keys can be specified using unique constraints. The attributes for the unique constraint should also be specified as being not null. Here is an example of how primary key and unique constraints are specified in MySQL:

CREATE TABLE Product (

ProdNum INTEGER NOT NULL,

Name CHAR(100) NOT NULL,

ProdVer DECIMAL(4,2) NOT NULL,

UnitPrice DECIMAL(6,2),

PRIMARY KEY(ProdNum),

UNIQUE(Name, ProdVer));

Below we show how to specify a primary key by altering a table. This assumes that the Product table has already been created, but the primary key has not yet been put in:

ALTER TABLE Product ADD PRIMARY KEY (ProdNum);

III.  Foreign Keys

A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is to ensure referential integrity of the data. In other words, only values that are supposed to appear in the database are permitted.

IV.  Check Constraints

check constraints specify conditions that each tuple in the table should satisfy. For example, the following addition of a check constraint added to the Product table ensures that Quantity in Order table must be between 1 and 1,000:

CREATE TABLE Order (

OrderNum INTEGER,

OrderTime TIMESTAMP,

ProdNum INTEGER,

Quantity INTEGER,

PRIMARY KEY (OrderNum),