SURE SHOT

BOOLEAN ALGEBRA

Q1. Prove First De Morgan’s Law algebraically.

ANS: (X+Y)’= X’ . Y’

(a)We know that A+A’=1 ------(1)

Let A = (X + Y)’, Then A’ = (X + Y)

Put the value of A & A’ in eqn(1)

(X + Y)’ + (X+Y) = 1

X’. Y’ + (X + Y) =1 (We know that U+WZ = (U + W)(U + Z), U=X + Y, W = X’, Z = Y’ )

(X + Y + X’)(X + Y + Y’) = 1

(1+Y)(X+1) = 1 ( We know X + X’ = 1)

1 . 1 = 1, Hence proved

(b)We know that A . A’ =0------(1)

Let A = (X . Y)’, Then A’ = (X . Y)

Put the value of A & A’ in eqn(1)

(X . Y)’.(X .Y) = 0

(X’ + Y’)(X.Y) = 0

X’ .X . Y + Y’ .X . Y =0 (By distributive law)

0 . Y + X . Y .Y’ =0 ( X . X’ =0)

0 . Y + X . 0 =0

0 + 0 = 0

0= 0 , Hence proved.

Q(2) Prove second Dorgan’s De Morgan’s law by TRUTH TABLE

(A . B)’ = A’ + B’

A / B / A’ / B’ / A’ + B’ / A.B / (A.B)’
0 / 0 / 1 / 1 / 1 / 0 / 1
0 / 1 / 1 / 0 / 1 / 0 / 1
1 / 0 / 0 / 1 / 1 / 0 / 1
1 / 1 / 0 / 0 / 1 / 0

Q(3) Reduce the following expression using K-MAP

F (A, B, C, D) = (0,1,2,3,8,9,10,12,13)

ANS:


F= C’.D’ + A’.C + B’.D’

Q(4) For the given truth table, give canonical product-of-sum(POS) and sum-of-product(SOP)

Also.

X / Y / Z / F / Minterm
0 / 0 / 0 / 0
0 / 0 / 1 / 1 / X’Y’Z
0 / 1 / 0 / 0
0 / 1 / 1 / 0
1 / 0 / 0 / 1 / XY’Z’
1 / 0 / 1 / 1 / XY’Z
1 / 1 / 0 / 0
1 / 1 / 1 / 1 / XYZ

F(X,Y,Z) = X’Y’Z+XY’Z’+XY’Z+XYZ (SOP)

Q(5) Write the Boolean expression for the logic circuit :

ANS: [(A+B)’.(A’.B)]’

Q(6) For the given truth table, give canonical product-of-sum(POS) and sum-of-product(SOP)

Also.

X / Y / Z / F / Maxterm
0 / 0 / 0 / 0 / X+Y+Z
0 / 0 / 1 / 1
0 / 1 / 0 / 0 / X+Y’+Z
0 / 1 / 1 / 0 / X+Y’+Z’
1 / 0 / 0 / 1
1 / 0 / 1 / 1
1 / 1 / 0 / 0 / X’+Y’+Z
1 / 1 / 1 / 1

ANS : F(X,Y,Z) = (X+Y+Z).(X+Y’+Z)(X+Y’+Z’)(X’+Y’+Z)(POS)

Q(7) Reduce the following Boolean expression using K-MapF(A,B,C,D) = π (0,1,3,4,5,6,7,9,10,11,13,15).

ANS: OCTATE: D’, QUAD1: A+C, QUAD2: A+B’, PAIR: A’+B+C’

F(A,B,C,D)= D’(A+C).(A+B’).(A’+B+C’)

SURE SHOT QUESTION BOOLEAN ALGEBRA CLASS XII CS

1(a) / State and Verify Absorption law algebraically. / 2
(b) / Draw a logic circuit for the following Boolean expression: ab+c.d’. / 2
(c) / Derive a Canonical POS expression for a Boolean function F, represented by the following truth table: / 1
(d) / Reduce the following Boolean Expression to its simplest form using K-Map:
F(X,Y,Z,W)= Σ (2,6,7,8,9,10,11,13,14,15) / 3

ANSWER:

1(a) / Absorption law states that:
A + AB = A and A . (A + B) = A
Algebraic method:
Taking LHS
A + AB = (A.1) + (A.B) by Identity
= A. (1+B) by Distribution
= A.1 by Null Element
= A
[1 mark for the statement]
[1 mark for proving it algebraically] / 2
(b) /
[1/2 mark for correct representation of each gate] / 2
(c) / F(P,Q,R)=(P+Q+R).(P+Q’+R’).(P’+Q+R).(P’+Q+R’)
(1 Mark for the correctly writing the POS form) / 1
(d) / / 3
2(a) / Verify the following using Truth Table.
U. (U' +V) = (U + V) / 2
(b) / Write the equivalent Boolean Expression for the following logic Circuit.
/ 2
(c) / Write the POS form of a Boolean function F, which is represented in a truth table as follows:
A / B / C / F
0
00 / 0
0 / 0
0 / 0
0
0
0 / 0
0 / 1
1 / 1
1
0
0 / 1
1 / 0
0 / 1
1
0
0 / 1
1 / 1
1 / 0
0
1
1 / 0
0 / 0
0 / 1
1
1
1 / 0
0 / 1
1 / 0
0
1
1 / 1
1 / 0
0 / 0
0
1
1 / 1
1 / 1
1 / 1
1
/ 1
(d) / Reduce the following Boolean Expression using K-Map:
F(P, Q, R, S) = Σ (0,1,2,4,5,6,8, 12) / 3

ANSWER 2:

6(a) /
VERIFIEDFALSE
(2MarkstobeawardedifTruthTableismadeORanyequivalentterm conveyingthesamemeaning) / 2
(b) / F=(X+Y').(X+Z')
(2 Marks for the final expression (X+Y').(X+Z') OR
(1 Mark for anyone of the correct terms out of (X+Y’) or (X+ Z’) / 2
(c) / F(A,B,C) = (A+B+C).(A+B'+C').(A'+B+C').(A'+B'+C)
(1 Mark for the correct POS form) / 1
(d) /
F(P,Q,R,S) = P'R' + R'S' + P'S'
(½ Mark for placing all 1s at correct positions in K-Map)
(½ Mark for each grouping)
(1 Mark for writing final expression in reduced/minimal form)
Note: Deduct ½ mark if wrong variable names are used / 3

3 Marks Questions

1. If F(a,b,c,d)=Σ(0,2,4,5,7,8,10,12,13,15), obtain the simplified form using K-Map.

2. Obtain a simplified form for a boolean expression

F(U,V,W,Z)= π (0,1,3,5,6,7,10,14,15)

2 Marks Questions

1.Write the equivalent Boolean Expression for the following Logic Circuit

2. Draw a Logical Circuit Diagram for the following Boolean expression:

A.(B+C’)

3. Prove x’.y’+y.z = x’yz+x’yz’+xyz+x’yz algebraically.

Sure Shot Questions Computer Science (Class XII)

Chapter: Database Concept & SQL

  1. Define Primary Key
  2. Define Candidate Key
  3. Define Relational Algebra
  4. Define Degree and Cardinality of a relation
  5. Table BANK has 2 rows and 3 columns. Table CUSTOMER has 4 rows and 3 columns. What will be the cardinality and degree of the Cartesian product of them?
  1. Consider the following tables BOOKS. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).

Table: BOOKS

B_Id / Book_Name / Author_Name / Publisher / Price / Type / Quantity
C01 / Fast Cook / LataKapoor / EPB / 355 / Cookery / 5
F01 / The Tears / William Hopkins / First / 650 / Fiction / 20
T01 / My C++ / Brain & Brooke / FPB / 350 / Text / 10
T02 / C++ Brain / A.W.Rossaine / TDH / 250 / Text / 15
F02 / Thuderbolts / Anna Roberts / First / 750 / Fiction / 50

i).To list the names from books of Text type.

ii).To display the names and price from books in ascending order of their price.

iii).To increase the price of all books of EPB publishers by 50.

iv).To display the Book_Name, Quantity and Price for all C++ books.

v).Select max(Price) from books;

vi).Select count(DISTINCT Publishers) from books where Price >=400;

vii).Select Book_Name, Author_Name from books where Publishers = ‘First’;

viii).Select min(Price) from books where type = ‘Text’;

  1. In a Database Multiplexes, there are two tables with the following data. Write MySQL queries for (i) to (iii), which are based on TicketDetails and AgentDetails :

Table: TicketDetails

Tcode / Name / Tickets / A_code
S001 / Meena / 7 / A01
S002 / Vani / 5 / A02
S003 / Meena / 9 / A01
S004 / Karish / 2 / A03
S005 / Suraj / 1 / A02

Table: AgentDetails

Acode / AName
A01 / Mr. Robin
A02 / Mr. Ayush
A03 / Mr. Trilok
A04 / Mr. John

(i)To display Tcode, Name and Aname of all the records where the number of tickets sold is more than 5.

(ii)To display total number of tickets booked by agent “Mr. Ayush”.

(iii)To display Acode, Aname and corresponding Tcode where Aname ends with 'k'.

  1. With reference to “TicketDetails” table, which column is the primary key? Which column is the foreign key? Give reason(s).
  1. Differentiate between count( ) & count(*).
  2. What doyou understand by the terms Alternate key and Foreign Key of a relation?

Solution

Answer: 1

It is a key/attribute or a set of attributes that can uniquely identify tuples within the relation.

Answer: 2

All attributes combinations inside a relation that can serve as primary key are candidate key as they are candidates for being as a primary key or a part of it.

Answer: 3

It is the collections of rules and operations on relations(tables). The various operations are selection, projection, Cartesian product, union, set difference and intersection, and joining of relations

Answer: 4

Degree – No. of Attributes

Cardinality – No of tuples

Answer: 5

Cardinality = Rows = 2 rows of BANK × 4 rows of CUSTOMER = 8 rows.

Degree = Columns = 3 columns of BANK + 3 columns of CUSTOMER = 6 columns.

Answer: 6

(i)SELECT Book_Name FROM BOOKS WHERE Type = ‘Text’;

(ii)SELECT Book_Name, Price FROM BOOKS ORDER BY Price ASC;

(iii)UPDATE BOOKS SET Price= Price+ 50 WHERE Publisher = ‘EPB’;

(iv)SELECT Book_Name, Quantity, Price FROM BOOKS WHERE Book_Name LIKE ‘%C++%’;

(v)

max(Price)
750

(vi)

count(DISTINCT Publishers)
3

(vii)

Book_Name / Author_Name
The Tears / William Hopkins
Thuderbolts / Anna Roberts

(viii)

min(Price)
250

Answer: 7

(i)SELECT Tcode, Name, Aname FROM TicketDetails t, AgentDetails a WHERE a.Acode=t.Acode;

(ii)SELECT SUM(Tickets) FROM TicketDetails t, AgentDetails a WHERE a.Acode=t.Acode AND Aname=’Mr. Ayush’;

(iii)SELECT Acode, Aname, Tcode FROM TicketDetails t, AgentDetails a WHERE a.Acode=t.Acode and Aname LIKE ‘%K’;

  1. With reference to “TicketDetails” table, which column is the primary key ? Which column is the foreign key? Give reason(s).

Answer: 8

Primary Key: Tcode Foreign Key: Acode

Answer: 9

Count( ) will count the number of tuples excluding NULL values. Count(*) will count the total number of rows in a table including NULL values.

Answer: 10

AlternateKey:Candidate key not selected as PrimaryKey.

ForeignKey: Key which is primary in one table if it exist in other table it is called Foreign in that table. OR Key whose underlying value depend s on the field where it is primary

Sure Shot Questions Computer Science (Class XII)

Chapter: Data Structure

  1. Define a function shift() to shift all odd elements towards left and even to right without changing order of numbers.
    Example: If input: 1,5,7,8,9,2,10
    Output: 1,5,7,9,8,2,10.
  2. Given two arrays A and B. Array ‘A’ contains all the elements of ‘B’ but one more element extra. Write a c++ function which accepts array A and B and its size as arguments/ parameters and find out the extra element in Array A. (Restriction: array elements are not in order)
    Example: - If Array A is {14, 21, 5, 19, 8, 4, 23, 11} and Array B is {23, 8, 19, 4, 14, 11, 5} Then output will be 21 (extra element in Array A)
  3. Write C++ function to Arrange (int [], in) to arrange all the negative and positive numbers from left to right.
    Example: - If an array of 10 elements initially contains {4, 5, 6,-7, 8,-2,-10, 1, 13,-20}. Then the function rearrange them in following manner {-20,-10,-7,-2 1, 4, 5, 6, 8, 13}
  4. Write a user defined function in C++ which accepts a squared integer matrix with odd dimensions (3*3, 5*5 …) & display the square of the elements which lie on both diagonals. For ex.:

2 5 7
3 7 2
5 6 9

  1. Rewrite the following codes after removing errors, if any, in the following snippet. Explain each error.

#include<iostream.h

void main()

{

int x[5], *y, z[5]

for (i = 0; i < 5; i ++)

{

x[i] = i;

z[i] = i + 3;

y = z;

x = y;

}

}

  1. Give the output of the following program:

void main()

{

int x [] = { 10, 20, 30, 40, 50}:

int *p, **q, *t;

p = x;

t = x + 1;

q = &t;

cout < *p < “,” < **q < “,” < *t++;

}

  1. Find the output of the following program :

#include<iostream.h

void main()

{

int Numbers[] = {12,4,10,8};

int *ptr = Numbers;

for (int C = 0; C<3; C++)

{

cout< *ptr < “@”;

ptr++;

}

coutendl;

for(C = 0; C<4; C++)

{

(*ptr)*=2;

--ptr;

}

for(C = 0; C<4; C++)

cout< Numbers [C]< “#”;

coutendl;

}

  1. Write the output of the follwoing program segment

#include<iostream.h

#include<string.h

#include<ctype.h

#include<stdio.h

void main()

{

char *NAME="ComPUteR";

clrscr();

for(int x=0;x<strlen(NAME);x++)

{

if(islower(NAME[x]))

NAME[x]=toupper(NAME[x]);

else

if(isupper(NAME[x]))

if(x%2==0)

NAME[x]=tolower(NAME[x]);

else

NAME[x]=NAME[x-1];

}

puts(NAME);

}

  1. What will be the output of the following program :

#include<iostream.h

#include<ctype.h

#include<conio.h

#include<string.h

voidchangestring(char text[], int &counter)

{

char *ptr = text;

int length=strlen(text);

for(;counter<length-2;counter+=2,ptr++)

{

*(ptr+counter) = toupper(*(ptr+counter));

}

}

void main()

{

clrscr();

int position = 0;

char message[]= "Mouse Fun";

changestring(message,position);

cout<message< "@" <position;

}

  1. Evaluate the following postfix notation of expression :

15 3 2 + / 7 + 2 *

  1. An array P[20][30] is stored in the memory along the column with each of the element occupying 4 bytes, find out the Base Address of the array, if an element P[2][20] is stored at the memory location 5000.
  2. An array ARR[5][25] is stored in the memory with each element occupying 4 bytes of space. Assuming the base address of ARR to be 1000, compute the address of ARR[5][7], when the array is stored as :

(i) Row wise (ii) Column wise.

  1. Write a function in c++ to delete a node containing Book’s information from a dynamically allocated stack of Books implemented with the help of the following structure

struct Book

{

intBno ;

charBname[20];

Book *Next ;

};

  1. Write a function in C++ to delete a node containing customer’s information, from a dynamically allocated Queue of Customers implemented with the help of the following structure :

struct Customer

{

intCNo;

charCName[20];

Customer *Link;

};

  1. Write a function in C++ to perform a PUSH operation in a dynamically allocated stack considering the following:

struct node

{

intx,y;

node *Link;

};

  1. Write a function in C++ to perform Push operation on a dynamically allocated Stack containing real numbers.

struct NODE

{

float Data; NODE *Link;

};

Solution

Answer 1.

void shift(int a[10],int n)
{
int b[10],i,k=0;
for(i=0;i<n;i++)
{
if(a[i]%2= =1)
{
b[k]=a[i];
k++;
}
}
for(i=0;i<n;i++)
{ if(a[i]%2= =0)
{ b[k]=a[i];
k++;
}
}
for(i=0;i<n;i++)
cout<b[i]<" ";
}

Answer 2.

void diagonalsquare(int a[10][10],intm,int n)
{
inti,j;
cout<"\nDiagonal one :";
for(i=0;i<m;i++)
{ for(j=0;j<n;j++)
if(i==j)
cout<a[i][j]*a[i][j]<",";}
cout<"\n\nDiagonal two:";
for(i=0;i<m;i++)
{ for(j=0;j<n;j++)
if(i+j==n-1)
cout<a[i][j]*a[i][j]<",";
}
}

Answer 3.

void extra(int a[10],intm,int b[10],int n)
{
inti,j,flag;
for(i=0;i<m;i++)
{ flag=0;
for(j=0;j<n;j++)
if(a[i]==b[j])
{ flag=1;
break;
}
if(flag==0)
cout<a[i]<" is the extra element\n";
}
}

Answer 4:

void arrange(int a[10],int n)
{
inti,j,temp;
for(i=0;i<n;i++)
{ for(j=0;j<n-1;j++)
if(a[j]>a[j+1])
{ temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
for(i=0;i<n;i++)
cout<a[i]<" ";
}

Answer 5.

#include<iostream.h

void main()

{

int x[5], *y, z[5] ;//Semicolon missing ;

for (i = 0; i < 5; i ++)// variable ‘i' is not defined

{

x[i] = i;

z[i] = i + 3;

y = z;

x = y;// value of x cannot be changed , as x is a array name, which

// is a pointer constant

}

}

Answer 6.

10, 30, 20

Answer 7.

2 @ 4 @ 8 @

4 # 8 # 16 # 20 #

Answer 8.

cOMMuTEE

Answer 9.

MouSe Fun@8

Answer 10.

Evaluation of the given postfix expression is explained below

Operator Scanned Stack Content

15 15

3 15, 3

2 15, 3, 2

+ 15, 5

/ 3

7 3, 7

+ 10

2 10, 2

* 20

Answer 11.

Given, W=4, N=20, M=30,

Loc(P[2][20])=5000

Column Major Formula:

Loc(P[I][J]) =Base(P)+W*(N*J+I)

Loc(P[2][20]) =Base(P)+4*(20*20+2)

Base(P) =5000 – 4*(400+2)

=5000 – 1608

=3392

Answer 12.

(i) Row wise :
Given, W = 4, N = 5, M = 25,
Base(ARR) = 1000
Row Major Formula:
Loc(ARR[5][7])= Base(ARR)+W*(M*I+J)
= 1000 + 4*( 25*5 + 7)
= 1000 + 4 * 132
= 1000 + 528
= 1528 / (ii) Column wise :
Given, W = 4, N = 5, M = 25,
Base(ARR) = 1000
Column Major Formula:
Loc(ARR[5][7])= Base(ARR)+W*(N*J+I)
= 1000 + 4*( 5*7 + 5)
= 1000 + 4 * 40
= 1000 + 160
= 1160

Answer. 13

Class stack

{

public:

book( )

{

top=NULL; }

void Push ( );

void Pop( );

void Display( );

~Book( );

};

void stack :: Pop( )

{

if (top != NULL)

{

stack *temp;

temp =Top;

cout<TopBno<Top “deleted”<endl;

Top= Top Next ;

delete Temp;

}

Else

cout< “stock Emplty” ;

}

Answer: 14

class QUEUE

{

Customer *Rear,*Front;

public:

QUEUE( ) { Rear=NULL; Front=NULL;}

void DELETE( );

~QUEUE( );

};

//Function definition DELETE()

void QUEUE::DELETE()

{

if(Front==NULL) // OR if(!Front)

cout<”\n Queue Underflow\n”;

else

{

Customer *Temp;

Temp=Front;

cout<Front->Cno”:”<Front->Cname <”Deleted”<endl;//To be ignored

Front=Front->Link;

delete Temp;

if (Front==NULL)

Rear=NULL;

}

}

Answer: 15

struct node

{ intx,y;

node *Link;

}*top, *temp;

void PUSH(node *np)

{

if(top = = NULL)

top = np;

else

{

temp = top;

top = np; // New node becomes to the first node

npLink = temp;

}

}

Answer: 16

class STACK

{

NODE *Top;

public:

STACK();

void Push();

void Pop();

};

void STACK::Push()

{

NODE *Temp;

Temp=new NODE;

cin>TempData;

TempLink=Top;

Top=Temp;

}

SURE SHOT QUESTIONS AND ANSWER

COMPUTER NETWORKING

Q1.Whatisa network?1

Ans : A network is interconnected collection of autonomous computers that can share andexchangeinformation.

Q2.Mentiontheadvantagesofnetworking.1

Ans : The advantages of networking are Resource sharing, Reliability, Reduced cost, Fastcommunication.

Q3.Defineserver.Mention thetypesofservers.1

Ans:Acomputerthatfacilitatesthesharingofdata,software,andhardwareresourcesonthenetworkistermedasserver.The twotypesofserversare non-dedicateddedicatedservers.

Q4.WhatisNIU?WhatdoestheMAC address referto?1

Ans:ANetworkInterfaceUnitisaninterpreterthathelpsestablishcommunicationbetweentheserverandworkstations.TheMACaddressreferstothephysicaladdressassignedbyNICmanufacturer.

Q5.Whatarethedifferenttypesofswitchingtechniques?1

Ans:Thedifferenttypesofswitchingtechniquesarecircuitswitching,Messageswitchingandpacketswitching.

Q6.Whatisacommunication channel?Give examplesofguidedmediaunguidedmedia.2

Ans:Communicationchannelmeanstheconnectingcablesthatlinkvariousworkstations.TheexamplesofguidedmediaareTwisted-paircables,Coaxialcables,Fibre-opticscables.Theexamplesofunguidedmediaaremicrowave,radiowave,satellite,infraredwave etc.

Q7.DefinethetermBandwidth.Giveanyoneunit ofBandwidth.2

Ans:Bandwidthisreferredtothevolumeofinformationperunitoftimethatatransmissionmedium(like anInternetconnection)canhandle.

OR

Theamountofdatathatcanbetransmittedinafixedamountoftimeisknownasbandwidth.Fordigitaldevices,thebandwidthisusuallyexpressedinbitspersecond(bps)orbytespersecond.Foranalogdevices,the bandwidthisexpressedincyclespersecond,orHertz(Hz).

Q8.Expand:HTTP,FTP,WLL,PSTN2

Ans:HTTP:HypertextTransferProtocol,FTP:FileTransferProtocol

WLL:WirelessLocalLoopPSTN: PublicSwitchedTelephone Network

Q9.Whatarethedifferenttypesof networks? 2 Ans: Thedifferenttypesofnetworks are :

(a)LocalAreaNetwork (LAN): This computernetworkisconfinedtoalocalisedarea suchasanoffice oracampus.

(b)MetropolitanAreaNetwork(MAN):Thisisthenetworkthatlinkscomputerfacilitieswithinacity.

(c)WideAreaNetwork(WAN):Thisnetworkspreadsoverlargedistanceslikeacrosscountries orevencontinents.

Q10.Whatdoyoumeanbynetworktopology?Whatarethemostpopulartopologies?2

Ans:Topologyreferstothewayinwhichtheworkstationsattachedtothenetworkareinterconnected.ThemostpopulartopologiesareBusTopology,RingTopology,StarTopology,TreeTopology.

Q11.Whatarethe advantagesofE-mail?2

Ans:TheadvantagesofE-mailareLowcost,Speed,Wastereduction,Easeofuse,Recordmaintenance,Patience.

Q12.WhatisWWW?WhataretheWWWattributes?2

Ans:TheWorldWideWeb(WWW)isasetofprotocolsthatallowyoutoaccessanydocumentontheNETthroughanamingsystembasedonURLs.ThevariousWWWattributesare:User-friendly,Multimedia documents,HypertextandHyperlinks,Interactive,Frames.

Q13.Whatiswebbrowser? Giveanytwoexamples ofwebbrowsers.2

Ans:AwebbrowserisaWWWclientthatnavigatesthroughtheWWWanddisplayswebpages.

ExamplesofwebbrowsersareInternetExplorer,Netscape NavigatorandMosaic.

Q14.Definetheterms:Website,Webpage,Homepage,Webportal 2

Ans:Website :Alocationon anetserveriscalleda website.

Webpage:AdocumentthatusesHypertextTransferProtocoliscalleda Webpage.Homepage :Thetop-levelwebpage ofawebsiteiscalledHome page.

Webportal:The websitewhichhostsotherwebsitesiscalledWebportal.

Q15.WhendoyoupreferXMLoverHTMLandwhy?2

Ans:ThefirstbenefitofXMListhatbecauseyouarewritingyourownmarkuplanguage,youarenotrestrictedtoalimitedsetoftagsdefinedbyproprietaryvendors.Ratherthanwaitingforstandardsbodiestoadopttagsetenhancements(aprocesswhichcantakequitesometime),orforbrowsercompaniestoadopteachother'sstandards,withXML,youcancreateyourownsetoftags atyourownpace.

Q16.Compareauthorisationwithauthentication.2

Ans:Authorisationdetermineswhethertheserviceproviderhasgrantedaccesstothewebservicetotherequestor.Authorisationisperformedbyaskingtheuseralegalloginid.Authenticationensuresthateachentityinvolvedinusingawebserviceiswhatactuallyclaimstobe.Itistermedaspasswordprotectionastheauthoriseduserisaskedtoprovideavalid password.

Q17.WhatisFirewall?Howfirewallprotectsournetwork?2

Ans:Thesystemdesignedtopreventunauthorisedaccesstoorfromaprivatenetworkiscalledfirewall.Itisadeviceorsetofdevicesconfiguredtopermit,deny,encrypt,decrypt,orproxyall(inandout)computertrafficbetweendifferentsecurity domainsbaseduponasetofrulesandothercriteria.

Q18.Whatarecookies?2

Ans:CookiesaremessagesthataWebservertransmitstoaWebbrowsersothattheWebservercankeeptrackofthe user’sactivityon a specificWebsite.

Q19.Howisacrackerdifferentfromahacker?IfsomeonehashackedyourWebsite,towhomyoulodgetheComplain? 2

Ans:Acrackerisamaliciousprogrammerwhobreaksintosecuresystemwhereasahackerismoreinterestedingainingknowledgeaboutcomputersystems.IfsomeonehashackedourWebsite thecomplainthas tobelodged withthePolice underITAct.

Q20.WhatisCyberlaw?2

Ans:Cyberlawisagenericterm,whichreferstoallthelegalandregulatoryaspectsofInternetandtheWorldWideWeb.

Q21.Expand:(i)FLOSS(ii)FSF(iii)OSI(iv)W3C 2

Ans:(i)FLOSS= Free Libre andOpenSource Software

(ii) FSF= Free SoftwareFoundation(iii)OSI=OpenSource Initiative

(iv)W3C =WorldWideWebConsortium

Q22.Whatisa computervirus? Write thebasic types ofviruses.3

Ans:Computervirusisamaliciousprogramthatrequiresahostandisdesignedtomakeasystemsick.BroadlythreetypesofvirusesareFileinfectors,BootSectorVirusesandMacroviruses.

Q23.Definetheterms :Trojan Horses,Worm,Spam.3

Ans:TrojanHorses:Itiscodehiddeninaprogramsuchasagameorspreadsheetthatlookssafetorunbuthas hiddensideeffects.

Worm:Awormisa programdesignedtoreplicate.

Spam:Itrefers toelectronicjunkmailorjunknewsgroupposting.

Q24. What is cloud computing? Write any two features of it.3

Ans. The practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer

Features : 1. On demand self service 2. Broad network access

3. Resource pooling4. Rapid elasticity

5. Measured service6. Non dependence on local hardware

Q25.KnowledgeSupplementOrganisationhassetupitsnewcentreatMangaloreforitsofficeandwebbasedactivities.Ithas4blocksofbuildingsasshown inthe diagram below:

BlockC

Centretocentredistancesbetweenvariousblocks

BlackAtoBlockB / 50m
BlockBtoBlock C / 150m
Block C toBlock D / 25m
BlockAtoBlock D / 170m
BlockBtoBlock D / 125m
BlockAtoBlock C / 9 m

NumberofComputers

(a)Suggestacablelayout ofconnectionsbetweentheblocks. 1

(b)Suggestthemostsuitableplace(i.e.block)tohousetheserverofthisorganisationwithasuitablereason. 1

(c)Suggesttheplacementofthefollowing devices with justification1

(i)Repeater(ii) Hub/Switch

(d)Theorganizationisplanningtolinkitsfrontofficesituatedinthecityinahillyregionwherecableconnectionisnotfeasible,suggestaneconomicwaytoconnectitwithreasonablyhighspeed? 1

Ans :(a)

OR

Block

C

BlockD

Layout2

Sincethe distancebetween BlockAand BlockBisquiteshort

(b)Themostsuitableplace/blocktohousetheserverofthisorganisationwouldbeBlockC,asthisblockcontains themaximumnumberof computers, thus decreasing thecablingcostformostofthecomputersaswellasincreasingtheefficiencyofthemaximumcomputersinthe network.

(c)(i)ForLayout1,sincethecablingdistancebetweenBlocksAandC,andthatbetweenBandCarequitelarge,soarepeatereach,wouldideallybeneededalongtheirpathtoavoidlossofsignalsduring thecourseofdataflow intheseroutes.

Forlayout2,sincethedistancebetweenBlocksAandCislargesoarepeaterwouldideallybeplacedinbetweenthis path

(ii)Ahub/switcheachwouldbeneededinalltheblocks,tointerconnectthegroupofcablesfromthedifferentcomputersineachblock.

Themosteconomicwaytoconnectitwithareasonablehighspeedwouldbetouseradiowavetransmission,astheyareeasytoinstall,cantravellongdistances,andpenetratebuildingseasily,sotheyarewidely usedforcommunication,bothindoorsandoutdoors.Radiowavesalsohavetheadvantageofbeingomnidirectional,whichistheycantravelinallthedirectionsfromthesource,sothatthetransmitterandreceiverdonot havetobecarefullyalignedphy

SURE SHOT QUESTIONS

(REVISION TOUR C++ Class-XI)

CLASS: XIISUBJECT: CS (083)

1 / Identify correct identifiers:-
Int char 123name money_control one#two toy123 switch _sys / 2
2 / Name the header file (s) required for successful compilation of the given code:
void main( )
{intRno=24;
char Name[ ]= “Aman”;
coutsetw(10)<Rnosetw(20)<Name<endl;
} / 1
3 / Rewrite the following program after removing all the syntactical errors underlining each correction, if any:
#include <iostream.h
class FLIGHT
{long FlightCode;
char Description[25];
public
void AddInfo( ){cinFlightCode; gets(Description);}
void ShowInfo( ){coutFlightCode:<Description<endl;}
};
void main( )
{FLIGHT F;
AddInfo.F();
F.ShowInfo( );
} / 2
4 / Write the output of the following program segment:
#include<iostream.h
struct THREE_D
{intx,y,z;
};
void movein(THREE_D &T, int step=1)
{T.x+=step;
T.y-=step;
T.z+=step;
}
void moveout(THREE_D &T, int step=1)
{T.x-=step;
T.y+=step;
T.z-=step;
}
void main( )
{THREE_D T1={10,20,5}, T2={30,10,40};
movein(T1);
moveout(T2,5);
cout<T1.x<","<T1.y<","<T1.z<endl;
cout<T2.x<","<T2.y<","<T2.z<endl;
movein(T2,10);
cout<T2.x<","<T2.y<","<T2.z<endl;
} / 3
5 / Write the output of the following program segment:
#include<iostream.h
#include<ctype.h
void main( )
{ charMystring[ ] = "what@ANIDea!";
for(int I=0; Mystring [I] ! = '\0' ; I++)
{ if(!isalpha (Mystring[I]) )
Mystring[I]= ' * ';
else if(isupper (Mystring[I] ))
Mystring[I] = Mystring[I]+1;
else
Mystring[I] = Mystring[I+1];
}
coutMystring;
} / 2
6 / In the following program, find the correct possible output(s) from the options:
# include <iostream.h
# include <stdlib.h
const int limit = 4;
void main ( )
{ int points;
randomize ( );
points = 100 + random (limit);
for (int P= points; P >= 100; P-- )
cout < P < “#”;
coutendl;
}
Output options:
i) 103#102#101#100#
ii) 100#101#102#103#
iii) 100#
iv) 104#103#102#101#100# / 2

MARKING SCHEME

1 / Int money_control toy123 _sys / ½ mark for each correct option
2 / iostream.h, (for cin, cout)
iomanip.h (for setw) / 1 (½ Mark for mentioning name of each header file)
3 / #include <iostream.h
#include <stdio.h
class FLIGHT
{long FlightCode;
char Description[25];
public:
void AddInfo( ){cinFlightCode; gets(Description);}
void ShowInfo( )
{coutFlightCode”:”<Description<endl;}
};
void main( )
{FLIGHT F;
F.AddInfo( );
F.ShowInfo();
} / 2 (½ Mark for mentioning each error)
4 / 11,19,6
25,15,35
35,5,45 / 3 (1 Mark for each correct line of output)
5 / hat@*BOJEa!* / 2 marks for correct output
6 / i) and iii) / 2 (1 Mark for each correct option)

SURE SHOT QUESTIONS

(FUNCTION OVERLOADING & OOPS)

CLASS: XIISUBJECT: CS (083)

1 / Define the term Data Hiding in the context of Object Oriented Programming. Give a suitable example using a C++ code to illustrate the same. / 2
2 / Differentiate between Protected and Private members of a class incontext of Inheritance using C++. / 2
3 / What do you understand by Polymorphism? Give a suitable example of the same. / 2
4 / What do you mean by Data Encapsulation? Also give a suitable example. / 2

MARKING SCHEME

1 / Data Hiding: Keeping the data in private visibility mode of the class to prevent it from accidental change is known as Data Hiding. Or Unessential features or background details are hidden from the outside world.
Example: Any one correct example / 2
(1 Mark for correct definition & 1 mark for example)
2 / Base Class Access Specifier Derived Class
Protected Private Private
Protected Protected
Public Protected
Private Private Not Accessible
Protected Not Accessible
Public Not Accessible / (1 mark each for correct explanation of Private and Protected members)
3 / Polymorphism: It is a method of using the same operator or function (method) to work using different sets of input. Function overloading is one of the example of polymorphism, where more than one function carrying same name behave differently with different set of parameters passed to them.
void Display()
{
cout<”Hello!”<endl;
}
void Display(int N)
{
cout<2*N+5<endl;
} / 2( 1MARK FOR DEFINITION AND 1 MARK FOR EXAMPLE)
4 / Definition of data encapsulation with example. / 2( 1 mark for definition and 1 mark for example)