Class XII Preboard 2 Marking Scheme Maths(Pg. 2), …€¦ · 1 Class XII Preboard 2 Marking Scheme...

57
1 Class XII Preboard 2 Marking Scheme Maths(Pg. 2), CS(Pg.18), IP(Pg.44) Class XII Preboard 1 Marking Scheme CS(Pg.49)

Transcript of Class XII Preboard 2 Marking Scheme Maths(Pg. 2), …€¦ · 1 Class XII Preboard 2 Marking Scheme...

1

Class XII Preboard 2

Marking Scheme

Maths(Pg. 2),

CS(Pg.18),

IP(Pg.44)

Class XII Preboard 1

Marking Scheme

CS(Pg.49)

2

MARKING SCHEME

SECOND PRE BOARD EXAMINATION

Sub: Mathematics( Code 041)

SECTION - A

1. ( ) 1

2. | | | | 1

3. Since (1,3) R , it is not transitive 1

4. | |=3 1

SECTION – B

5. L.H.S = tan-1

x+tan-1

=tan-1(

( )

( ) ) 1

=tan-1(

) 1/2

=tan-1(

) =R.H.S 1/2

6.

1

*

+ and Q=

*

+ 1

7.

2Slope of the curve = 5 6dy

xdx

12dyd dx

xdt dx dt

= - 72 unit/sec 1+1

8.

sin

log sin log

xy x

y x x

1/2

1 sin

cos logdy x

x xy dx x

1/2

sin

cos logdy x

y x xdx x

1

3

9. dxx

xx

2

2

cos

)sin22cos( = dx

x

xx

2

22

cos

)sin2sin21( 1

= dxx

2cos

1 = dxx

2sec = tan x +c 1

10. Degree = 1

Order = 3 1 ½

Degree + order =3+1=4 ½

11.

We have .ˆ3ˆ2ˆ,ˆˆˆ kjibkjia

( + ) kji ˆ4ˆ3ˆ2 and ( - ) .ˆ2ˆ kj

A vector which is perpendicular to both vectors ( + ) and ( - ) is given by

( + ) × ( - ) =|

| 1 ½

|( ) ( )| = 2√

Therefore, the required unit vector is kji ˆ

6

1ˆ6

2ˆ6

1

½

12. 1

1

SECTION –C

13. A = [

]

We know that A = I3 A

i.e. [

] = [

] A

operate R2 R2 – 2R1

[

] = [

] A

4

Operate R1 R2 to make a11 = 1

[

] = [

] A 1 ½

operate R2 R2 – 2R1 to make a21 =0

[

] = [

] A

Operate R2 R3 to make a22 = 1

[

] = [

] A 1 ½

operate R1 R1 – R2 and R3 R3 + 2R2

[

] = [

] A

operate R1 R1 + R3 and R2 R2 - 3R3

[

] = [

] A

Hence, A-1 = [

] 1

14. Given function, ( ) {

At , we have ( )

LHL= ( )

(

)

=1 1 ½

RHL= ( )

5

(

)

For ( ) to be continuous at we must have

( )

( ) ( )

So, k=1. 1

Or

For ( ) to be continuous at we must have

( )

( ) ( )

=

( )

( ) ........................... (i)

Now, LHL=

( )

(

)

=

(

)

=8........................... (ii) 2

RHL=

( )

√ √

√ √ (√ √ )

(√ √ ) ............................. (iii) 1

From (i), (ii) and (iii),

we get 1

15. Given,

Taking log on both sides, we get

Differentiating both sides w.r.t x

( ) 2

Again, differentiating both sides wrt x

( )

(

)

2

16. We have f (x) = 4x3– 6x

2– 72x + 30

6

1 f ′(x) = 12x2 – 12x – 72 = 12 (x2 – x – 6) = 12 (x – 3) (x + 2) Therefore, f ′(x) = 0 gives x = – 2, 3. 2 The points x = – 2 and x = 3 divides the real line into three disjoint intervals, namely, (– ∞, – 2), (– 2, 3) and (3, ∞). In the intervals (– ∞, – 2) and (3, ∞), f ′(x) is positive while in the interval (– 2, 3), f′(x) is negative. Consequently, the function f is strictly increasing in the intervals (– ∞, – 2) and (3, ∞) while the function is strictly decreasing in the interval (– 2, 3). However, f is neither increasing nor decreasing in R. 1

Or

We have f(x) = sin x + cos x, f ′(x) = cos x – sin x

Now f ′(x) = 0 gives sin x = cos x which gives that

as 0 ≤ x ≤ 2π 1

The points

divide the interval [0, 2π] into three disjoint intervals,

Namely *

* (

) (

2

f’(x) > 0 if x ∈ [

) ∪ (

]

Or f is strictly increasing in the intervals [0,

) and (

]

and if f’(x) < 0 than f is strictly decreasing in (

) 1

17. The given right circular cone of fixed height (h) and semi-vertical angle (α) can be drawn as:

7

Here, a cylinder of radius R and height H is inscribed in the cone.

Then, ∠GAO = α, OG = r, OA = h, OE = R, and CE = H.

We have, r = h tan α

Now, since ΔAOG is similar to ΔCEG, we have:

1 ½

Now, the volume (V) of the cylinder is given by,

1 ½

And, for R = (2h/3) tanα , we have:

∴By second derivative test,

the volume of the cylinder is the greatest when R = (2h/3) tanα

8

Thus, the height of the cylinder is one-third the height of the cone when the volume of the cylinder is the greatest.

Now, the maximum volume of the cylinder can be obtained as:

Hence, the given result is proved. 1

18. Let E1 and E2 be the events of drawing ace in first and second draw respectively.

Let X be the random variable representing the no. of aces,

then the value of X may b 0,1 and 2.

So, P(X=0) = P( ) = P( ) P( / )=

×

=

1

P(X=1)= P( )

=P( ) P(E2/ )+P(E1) P( ) 1

=

×

+

×

=

P(X=2)= P(E1 E2)

=P(E1) P(E2/E1) =

×

=

1

So the probability distribution of random variable X is shown in the following table:

X=xi P(X=xi)=pi xi2 pixi pixi2

0

0 0 0

1

1

2

4

∑pixi=

∑pixi2=

1 ½

Mean (µ) = ∑ pi xi =

Variance = ∑ pi xi 2 - ( ∑ pi xi ) 2

=

9

=

1 ½

19. Let 3x +1 = Bxxdx

d )25( 2

1/2

A = -3/2 and B = -2 1/2

For finding I1 = -3 225 xx 1+1/2

For finding I2 = 2

6

1sin 1 x

+ C 1 +1/2

20. (cot ) cosdx

y x ydy

=> ∫ = siny 1

Therefore solution is:

2

2

2 sin sin 2

0, 0... 0

2 sin sin

x y y c

x y c

x y y

1+1+1

Or

xy

yx

dx

dy

2

)( 22

Let y = vx => dx

dvxv

dx

dy 1 ½

The D.E. reduces to

x

dxdv

v

v

vx

vx

dx

dvxv

22

22

1

2

2

)1(

cxyxcxvx

dxdv

v

v

log)log(log)1log(

1

2 222

2 …….(1) 1 ½

Now put x=1, y=1 , then C=log2

From (1), xyxx

yx2)(2loglog 22

22

. 1

10

21. = (3 - +4 ) – ( + ) = 3 - 2 + 3 1

=

– +

A

B M C 2

|

| = |

| =

1

22. Any point on line

=

=

= …………. (1)

is (2 +1 , 3 -1 , 4 +1)

and any point on line

=

=

= …………….. (2)

is ( +3, 2 + k , )

If lines (1) and (2) intersect ,then for some values of and

2 +1 = +3 , 3 -1 = 2 + k and 4 +1 = Solving

these equations we get

2 +1 = (4 +1) +3

2 = -3 = -

and = 4 (-

) + 1 = - 6 +1 = - 5 1 ½

∴ 3 -1 = 2 + k 3( -

) -1 =2 (-5) +k

k -10 = -

k = 10 -

=

The lines (1) and (2) are parallel to the vectors b1 and b2 given by –

b1 = ˆˆ ˆ2 3 4i j k and b2 = ˆˆ ˆ2i j k

11

Also line (1) passes through the point (1, - 1, 1) .So, the plane containing the two lines

passes through the point whose position vector is

ˆˆ ˆa i j k and is perpendicular to the vector N given by-

N = b1 x b2 = |

| = (3-8) i +(4 – 1) j + (4 – 3) k = -5 i +3 j + k 1 ½

So, the vector equation of the plane containing the given line is

ˆˆ ˆ( ). 0r a N ˆˆ 3( ˆ5   . )ir j k =

ˆ ˆˆ ˆ ˆ ˆ( ).( 5 3 )i j k i j k

ˆˆ 3( ˆ5   . )ir j k = - 6

ˆ ˆˆ ˆ ˆ ˆ( ).( 5 3 )xi yj zk i j k = -6

5x +2y +z +6 = 0 1

23. Let E1 be the events that she gets 5 or 6

and E2 be the events that she gets 1, 2, 3 or 4.

Then P(E1)=

=

,

P(E2)=

=

Let A be the event that she obtained exactly one head then

P(A/E1) =

, P(A/E2) =

1 ½

We have to find the probability that she threw 1,2,3 or 4 with the die

given that she obtained exactly one head, i.e.

P(E2/A)= ( ) (

)

( ) (

) ( ) (

) 1 ½

=

=

=

=

1

12

SECTION – D

24. For operation ‘ ’

‘ : R × R R s.t. a b =|a-b| ∀ a,b ∈ R

i) COMMUTATIVITY :

a b =|a-b|

=|b-a| = b a

i.e. , ‘ ’ is commutative.

ii) ASSOCIATIVITY :

∀ a,b,c ∈ R

(a b) c = |a-b| c =| |a-b| - c |

a ( b c) = a |b- c| =|a-| b- c | |

But | |a-b| - c |≠|a-| b- c | |

⇒ (a b) c ≠ a ( b c) ∀ a,b,c ∈ R

⇒ ‘ ’ is not associative.

Hence, ‘ ’ is commutative but not associative 3

For operation ‘o’

‘ : R × R R s.t. a b =a ∀ a,b ∈ R

ii) COMMUTATIVITY :

a b =a ≠ b o a

i.e. , ‘o’ is not commutative.

ii) ASSOCIATIVITY :

∀ a,b,c ∈ R (a b) c = a o c = a and a ( b c) = a b = a

⇒ (a b) c = a ( b c) ∀ a,b,c ∈ R

⇒ ‘ ’ is associative.

Hence, ‘ ’ is not commutative but associative. 3

13

OR

4

AND f -1 (3) = 2/3 f - 1 (-2) = 1/3 2

25. Take common x from R2 & x(x-1) from R3

x2 (x-1) |

( ) ( )

( ) ( ) ( )| 2

Take (x+1) common from C3

x2 (x-1)(x+1) |

( )

( ) ( ) | 2

R2=R2-R1 & R3= R3-R1

Expand C3 to get answer. 2

26.

14

1

3

2

∫ ( )

Here a=1,b=3,h=

∫ ( )

= ( ( ) ( ) ( ) ( ( ) ) 1

(( ) ( ) ( ( ) ( )

( ) ) 1

[ ( ( ) ) ( ( ))

( ( ) )] 1

= * ( )

( )

( )( )

+ 2

= ( )

1/2

= ( )

1/2

27.

15

Figure 1

The equations are y=| | ={ ( )

When , (x=-4,y=1) ,(x=-5,y=2) ,(x=-6,y=3)

When , (x=-1,y=2) ,(x=-2,y=1) ,(x=-3,y=0)

=9 Sq.units. 2

Therefore Required area =

=∫ | |

+∫ | |

=∫ ( )

+∫ ( )

=*

+

*

+

=*(

)—( )+ *

+

=

=9 Sq.units. 3

28.

Let x machines of type A and y machines of the type B are bought to maximize the daily output. Then, the LPP is Maximize Subject to,

i.e

To solve this LPP graphically, we first convert the inequations into equations and draw the corresponding lines. The feasible region of the LPP is shaded in fig. The corner point of the feasible region OABC are O (0, 0), A (6, 0), B (4, 3) and C (0, 38/5). These points have been obtained by solving the corresponding interesting lines, simultaneously.

16

3

The values of the objective function are given in the following table:

Point(x,y) Value of the objective function Z=60x+40y

O(0,0) A(6,0) B(4,3)

C(0,38/5)

Z=60×0+40×0=0 Z=60×6+40×0=360 Z=60×4+40×3=360 Z=60×0+40×(38/5)=304

Hence Z is maximum at A (6, 0), B(4, 3) Hence he should buy either 6 machines of type A and no machines of type B 3 Or 4 machines of type A and 3 machines of type B to maximize daily output.

Or The given data can be put in the tabular form:

Suppose refinery A and B should run for x days and y days respectively to minimize the total cost.

Then mathematical form of the above LPP is

Minimize

Refinery High grade Medium grade Low grade Costs per day

A 100 300 200 ₹ 400

B 200 400 100 ₹ 300

Minimum Requirement 12,000 20,000 15,000

17

Subject to,

To solve this LPP graphically, we first convert the inequations into equations and draw the corresponding lines. The feasible region of the LPP is shaded in fig. The corner point of the feasible region OABC are A2(120,0),P(60,30), B3(0,150).These points have been obtained by solving the corresponding interesting lines, simultaneously. The values of the objective function are given in the following table: 3

Point(x,y) Value of the objective function Z=400x+300y

A2(120,0) P(60,30) B3(0,150)

Z=400×120+300×0=48000 Z=400×60+300×30=33000 Z=400×0+300×120=45000

Hence Z is minimum at P(60,30).The feasible region is unbounded. So, we find the half-plane represented by 400x+300y≤33000. Hence, the machine A should run for 60 days and the machine B run for 30 days to minimize the cost while satisfying the constraints. 3

29. The repeated tosses of a coin are Bernoulli trials. Let X denote the number of heads in an experiment of 10 trials.

So, X has binomial distribution with n=10 and p= ½ P(X=x) =

, x = 0,1,2…,n

n = 10 , p = ½ , q= 1-p = ½

P(X=x) =

18

(i) P(X=6) =

= 105/512 2

(ii) P(X >= 6) =

+

= 193/512 2

(iii) P(X <= 6) =

+

+

= 53/64 2

MARKING SCHEME COMPUTER SCIENCE 083

PRE-BOARD –II 2017-18

1 (a) Out of the following, find those identifiers, which cannot be used for naming 2 Variable, Constants or Functions in a C++ program:

_Cost, Price*Qty, float, Switch,

Address One, Delete, Number12, do

Ans Price*Qty

float

Address One

do

(½ Mark for each correct name)

Note:

Deduct ½ Mark for each wrong name written

(b) Jayapriya has started learning C++ and has typed the following program. When 1

she compiled the following code written by her, she discovered that she needs to

include some header files to successfully compile and execute it. Write the

names of those header files, which are required to be included in the code.

void main()

{

float A,Number,Outcome;

cin>>A>>Number;

Outcome=pow(A,Number);

cout<<Outcome<<endl;

}

Ans ● iostream.h OR iomanip.h

19

● math.h

(½ Mark for writing each correct header file)

Note: ● Ignore any other header files, if mentioned.

(c) Rewrite the following C++ code after removing any/all syntactical errors with 2

each correction underlined.

Note: Assume all required header files are already being included in the program.

#define Equation(p,q) = p+2*q

void main()

{

float A=3.2;B=4.1;

C=Equation(A,B);

cout<<‟Output=‟<<C<<endl;

}

Ans #define Equation(p,q) p+2*q

void main()

{

float A=3.2, B=4.1;

floatC=Equation(A,B);

cout<<”Output=”<<C<<endl;

}

(½ Mark for each correction)

OR

(1 mark for identifying the errors, without suggesting corrections)

(d) Find and write the output of the following C++ program code: 2

Note: Assume all required header files are already included in the

program.

typedef char STRING[80];

void MIXITNOW(STRING S)

{

int Size=strlen(S);

for (int I=0;I<Size-1;I+=2)

{

char WS=S[I];

S[I]=S[I+1];

S[I+1]=WS;

}

for (I=1;I<Size;I+=2)

if (S[I]>=‟M‟ && S[I]<=‟U‟)

S[I]=‟@‟;

20

}

void main()

{

STRING Word=”CRACKAJACK”;

MIXITNOW(Word);

cout<<Word<<endl;

}

Ans RCCAAKAJKC

(2 Marks for correct output)

OR

(½ Mark for each of two correct consecutive alphabets not exceeding

1½ marks )

(e) Find and write the output of the following C++ program code: 3

Note: Assume all required header files are already being included in the program.

class Stock

{

long int ID;

float Rate; int Date;

public: Stock(){ID=1001;Rate=200;Date=1;}

void RegCode(long int I,float R) { ID=I; Rate=R;

} void Change(int New,int DT) { Rate+=New; Date=DT;

} void Show() { cout<<”Date :”<<Date<<endl; cout<<ID<<”#”<<Rate<<endl;

} }; void main() {

Stock A,B,C; A.RegCode(1024,150); B.RegCode(2015,300); B.Change(100,29); C.Change(-20,20); A.Show(); B.Show(); C.Show();

}

21

Ans Date :1

1024#150 Date :29 2015#400 Date :20 1001#180

(½ Mark for each correct line of output)

Note: ● Deduct only ½ Mark for not writing any or all ‘Date’ OR ‘:’ OR ‘#’

symbol(s) ● Deduct ½ Mark for not considering any or all endl(s) at proper

place(s)

(f)Look at the following C++ code and find the possible output(s) from the options 2

(i) to (iv) following it. Also, write the maximum and the minimum values that can

be assigned to the variable CHANGER.

Note:

● Assume all the required header files are already being included in the code.

● The function random(n) generates an integer between 0 and n‐1

void main()

{

randomize();

int CHANGER;

CHANGER=random(3);

char CITY[][25]={”DELHI”,”MUMBAI”,”KOLKATA” ,”CHENNAI”};

for(int I=0;I<=CHANGER;I++)

{

for(int J=0;J<=I;J++)

cout<<CITY[J];

cout<<endl;

}

}

(i) (ii)

DELHI DELHI

DELHIMUMABAI DELHIMUMABAI

DELHIMUMABAIKOLKATA DELHIMUMABAIKOLKATA

DELHIMUMABAIKOLKATACHENNAI

(iii) (iv)

MUMABAI KOLKATA

MUMABAIKOLKATA KOLKATACHENNAI

MUMABAIKOLKATACHENNAI

22

Ans (i) DELHI DELHIMUMBAI DELHIMUMBAIKOLKATA

Minimum Value of CHANGER = 0 Maximum Value of CHANGER = 2

(1 Mark for mentioning correct option) Note: No Mark to be awarded for writing any one additional option

with (i) .

(½ Mark each for Minimum and Maximum Value of CHANGER)

2. (a)Differentiate between Constructor and Destructor functions giving suitable 2 example

using a class in C++. When does each of them execute?

Ans PART 1:

Constructor Destructor

A constructor function has same name A destructor function has same name

as the class as the class preceded by ~ symbol

Example:

class Exam

{

float Marks;

int Eno;

public: //Constructor

Exam()

{

Eno=1; Marks = 100; cout<<”Constructor executed...”<<endl;

} void Show() {

cout<<Eno<<”#”<<Marks<<endl; } ~Exam() //Destructor {

cout<<”Exam Over”<<endl; }

}; void main() {

Exam E; //Executes constructor E.Show();

23

} //Executes Destructor

OR Any other suitable example demonstrating difference between

Constructor and Destructor functions.

PART 2: Execution of Constructor and Destructor: Constructor Destructor

A constructor executes by itself at A destructor executes by itself

the time of object creation when the scope of an object

ends

PART 1: (1Mark for correct example of constructor and destructor function) OR (½ Mark each for correct definition of constructor and destructor function)

PART 2: (1 Mark for constructor and Destructor execution with/without

example )

(b) Observe the following C++ code and answer the questions (i) and (ii). Assume all

necessary files are included:

class FICTION

{ long FCode; char

FTitle[20];

float FPrice; public:

FICTION() //Member Function 1 { cout<<”Bought”<<endl; FCode=100;strcpy(FTitle,”Noname”);FPrice=50;

}

FICTION(int C,char T[],float P) //Member Function 2

{

FCode=C; strcpy(FTitle,T);

24

} FPrice=P;

//Member Function 3

void Increase(float P)

{

FPrice+=P;

}

//Member Function 4

void Show()

{

cout<<FCode<<”:”<<FTitle<<”:”<<FPrice<<endl;

}

//Member Function 5

~FICTION()

{

cout<<”Fiction removed!”<<end1;

}

};

//Line 1

void main()

{ //Line 2

FICTION F1,F2(101,”Dare”,75); //Line 3

for (int I=0;I<4;I++) //Line 4

{ //Line 5

F1.Increase(20);F2.Increase(15); //Line 6

F1.Show();F2.Show(); //Line 7

} //Line 8

} //Line 9

(i) Write statements that will call function1 and function4. 1 1

Ans FICTION F; F.Show();

(1Mark for mentioning the correct concept name )

(ii) ii)Introduce a copy constructor in the class write the complete definition of it 1

25

Ans

FICTION(FICTION &OB)

{ FCode=OB.FCode;

strcpy(FTitle,OB.FCode);

FPrice=OB.FPrice;

}

(c) Write the definition of a class METROPOLIS in C++ with following description: 4

Private Members

­ Mcode //Data member for Code (an integer)

­ MName //Data member for Name (a string)

­ MPop //Data member for Population

(a long int)

­ Area //Data member for Area Coverage

(a float)

­ PopDens //Data member for Population

Density (a float)

­ CalDen() //A member function to calculate ­­­­­­­

//Density as PopDens/Area Public Members

­ Enter() //A function to allow user to enter

values of

//Mcode,MName,MPop,Area and call

CalDen()

//function

­ ViewALL()//A function to display all the data members

//also display a message

”Highly Populated Area”

//if the Density is more than 12000

Ans class METROPOLIS

{

int Mcode;

char MName[20];

long int MPop;

float Area;

float PopDens;

void CalDen();

public:

void Enter();

void ViewALL();

};

void METROPOLIS::Enter()

{

cin>>Mcode;

gets(MName); //ORcin>>MName;

cin>>MPop;

26

cin>>Area;

CalDen();

}

void METROPOLIS::ViewALL()

{

cout<<Mcode<<MName<<MPop<<Area<<PopDens; //Ignore endl if(PopDens>12000)

//Ignore endl

cout<<”Highly Populated Area”;

} void METROPOLIS::CalDen() {

PopDens= PopDens/Area; //ORPopDens = MPop/Area }

(½ Mark for correct syntax for class header) (½ Mark for correctly ending the class declaration with a semicolon) (½ Mark for correct declaration of data members) (½ Mark for correct definition of CalDen() function) (1 Mark for correct definition of Enter() with proper invocation of

CalDen() function) (1 Mark for correct definition of ViewALL())

NOTE: ● Deduct ½ Mark if CalDen() is not invoked properly inside Enter()

function ● Marks not to be deducted if any or all the member functions are

defined inside the class ● Marks not to be deducted if Densityis declared as an extra data member and

calculated as Density=PopDens/Area inside CalDen()function

● Marks not to be deducted if Densityis declared as an extra data

member and checked as if (Density>12000)in lieu of

if (PopDens>12000) inside ViewALL()function

d)i)readphysicsbook(),showphysicsbook(),readtextbook(),

showtextbook(),read(),show();

ii)readtextbook(),showtextbook()

iii)readphysicsbook(),showphysicsbook(),readtextbook(),

showtextbook()

iv)56 bytes.

One mark for correct answer

3.a)

3

.

void AddEnd2 (int A [ ] [4], int N, int M) 2

27

{

int sum=0;

for(int i=0;i<M;i++)

{

for(int j=0;j<N;j++)

{

if(A[i][j]%10==2)

{

sum+=A[i][j];

}

}

}

cout<<sum;

}

(b)

T[20][50] is a two dimensional array, which is stored in the memory along the column 3

with each of its element occupying 4 bytes, find the address of the element

T[15][5], if the element T[10][8] is stored at the memory location 62000.

Ans 61320,61780 (1 Mark for writing correct formula (for column major) OR substituting

formula with correct values)

(1Mark for correct calculation )

(1 Mark for final correct address)

(c) Write the definition of a member function INSERT() for a class QUEUE in C++, to 4

insert an ITEM in a dynamically allocated Queue of items considering the following

code is already written as a part of the program.

struct ITEM

{

int INO; char INAME[20];

ITEM *Link;

};

class QUEUE

{

ITEM *R,*F;

public:

QUEUE(){R=NULL;F=NULL;}

void INSERT();

void DELETE();

~QUEUE();

};

Ans void QUEUE::INSERT()

{

28

ITEM *T = new ITEM;

cin>>T->INO; gets(T->INAME); //OR cin>> T->INAME; T->Link = NULL; if(R==NULL) { F=T; R=T;

} else { R->Link=T; R=T;

} }

( 1 Mark for creating a new node)

( ½ Mark for entering data for the new node)

( ½ Mark for assigning NULL to link of the new node)

( ½ Mark for assigning Front to the first node as F = T)

( ½ Mark for linking the last node to the new node as R‐>Link =T)

( 1 Mark for assigning Rear to the new node as R = T)

(d)Write definition for a function SHOWMID(int P[][5],int R,int C) in C++ to display the 3

elements of middle row and middle column from a two dimensional array P having

R number of rows and C number of columns.

For example, if the content of array is as follows:

115 112 116 101 125

103 101 121 102 101

185 109 109 160 172

The function should display the following as output : 103 101 121 102 101

116 121 109

ANS void SHOWMID(int P[][5],int R,int C)

{

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

cout<<P[R/2][J]<< “ “;

cout<<endl;

for (int I=0;I<R;I++)

cout<<P[I][C/2]<< “ “;

}

OR void SHOWMID(int P[][5],int R,int C)

{

29

if(R%2!=0)

{

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

cout<<P[R/2][J]<< “ “;

}

else

cout<<”No Middle Row”;

cout<<endl;

if(C%2!=0)

{

for (int I=0;I<R;I++)

cout<<P[I][C/2]<< “ “;

}

else

cout<<”No Middle Column”;

}

OR Any other correct equivalent function definition

( ½ Mark for correct loop for displaying middle row elements)

( 1 Mark for correct statement to display middle row elements)

( ½ Mark for correct loop for displaying middle column elements)

( 1 Mark for correct statement to display middle column elements)

(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2

the stack contents for each step of conversion.

A/(B+C)*D­E

Ans A/(B+C)*D­E

= (((A / (B+C)) * D) ­ E)

Element Stack of Operators Postfix Expression

(

(

(

A A

/ / A

( / A

B / AB

+ /+ AB

C /+ ABC

) / ABC+

) ABC+/

* * ABC+/

30

D * ABC+/D

) ABC+/D*

­ ­ ABC+/D*

E ­ ABC+/D*E

) ABC+/D*E­

= ABC+/D*E­

OR

A/(B+C)*D­E

= (A / (B+C) * D ­ E)

Element Stack of Operators Postfix Expression

( (

A ( A

/ (/ A

( (/( A

B (/( AB

+ (/(+ AB

C (/(+ ABC

) (/ ABC+

* (* ABC+/

D (* ABC+/D

­ (­ ABC+/D*

E (­ ABC+/D*E

) ABC+/D*E­

= ABC+/D*E­

31

OR

Any other method for converting the given infixexpression to its

equivalent postfix expression showing stack contents.

(½ Mark for correctly converting till each operator)

OR

(1 Mark to be given for writing correct answer without showing the

stack content on each step)

4. (a) Write function definition for WORD4CHAR() in C++ to read the content of a text 2

file FUN.TXT, and display all those words, which has four characters in it.

Example:

If the content of the file fun.TXT is as follows:

When I was a small child, I used toplayinthegarden

with my grand mom. Those days were amazingly funful

and I remember all the moments of that time

The function WORD4CHAR() should display the following:

When used play with days were that time

Ans void WORD4CHAR()

{

ifstream Fil;

Fil.open(“FUN.TXT”);

char W[20];

while(!Fil.eof()) //OR while(Fil)

{ Fil>>W;

if (strlen(W)) == 4 ) //Ignore words ending with „.‟

cout<<W<< “ “;

}

//Ignore

Fil.close();

}

OR Any other correct function definition

(½ Mark for opening FUN.TXT correctly) (½ Mark for reading each word (using any method)from the file)

32

33

(½ Mark for checking length of the extracted word to be of 4 letters)

(½ Mark for displaying the 4 letter extracted word correctly)

(b) Write a definition for function BUMPER( ) in C++ to read each object of a binary 3

file GIFTS.DAT, find and display details of those gifts, which has remarks as “ÖN

DISCOUNT”. Assume that the file GIFTS.DAT is created with the help of objects of

class GIFTS, which is defined below:

class GIFTS

{

int ID;char Gift[20],Remarks[20]; float Price;

public:

void Takeonstock()

{

cin>>ID;gets(Gift);gets(Remarks);cin>>Price;

}

void See()

{

cout<<ID<<”:”<<Gift<<”:”<<Price<<””:”<<Remarks<<endl;

}

char *GetRemarks(){return Remarks;}

};

Ans void BUMPER()

{

GIFTS G;

ifstream fin;

fin.open(“GIFTS.DAT”, ios::binary);

while(fin.read((char*)&G, sizeof(G)))

{

if(strcmp(G.GetRemarks(),”ON DISCOUNT”)==0)

G.See();

}

fin.close(); //Ignore

}

OR

Any other correct function definition

(1Mark for opening GIFTS .DAT correctly)

(½ Mark for reading records from GIFTS.DAT)

(½ Mark for comparing Remarks with ON DISCOUNT (ignore case sensitive

checking))

(1 Mark for displaying record)

34

(c) Find the output of the following C++ code considering that the binary file MEM.DAT 1

exists on the hard disk with a data of 1000 members.

class MEMBER

{

int Mcode;char MName[20];

public:

void Register();void Display();

};

void main()

{

fstream MFile;

MFile.open(“MEM.DAT”,ios::binary|ios::in);

MEMBER M;

MFile.read((char*)&M, sizeof(M));

cout<<”Rec:”<<MFile.tellg()/sizeof(M)<<endl;

MFile.read((char*)&M, sizeof(M));

MFile.read((char*)&M, sizeof(M));

cout<<”Rec:”<<MFile.tellg()/sizeof(M)<<endl;

MFile.close();

}

Ans Rec:1

Rec:3

(½ Mark for each correct value of MFile.tellg()/sizeof(M) as 1 and 3

respectively)

5 (a) Observe the following STUDENTS and EVENTS tables carefully and write the name 2

of the RDBMS operation which will be used to produce the output as shown in LIST

? Also, find the Degree and Cardinality of the LIST.

STUDENTS EVENTS

NO NAME EVENTCODE EVENTNAME

1 Tara Mani 1001 Programming

2 Jaya Sarkar 1002 IT Quiz

3 Tarini Trikha

LIST

NO NAME EVENTCODE EVENTNAME

1 Tara Mani 1001 Programming

1 Tara Mani 1002 IT Quiz

2 Jaya Sarkar 1001 Programming

2 Jaya Sarkar 1002 IT Quiz

3 Tarini Trikha 1001 Programming

35

3 Tarini Trikha 1002 IT Quiz

Ans

Degree=2

Cardinality=3

Degree = 4

Cardinality = 6

(1 Mark for writing the correct name of RDBMS operation)

(½ Mark for writing correct value of degree)

(½ Mark for writing correct value of cardinality)

(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), 6

which are based on the tables

Table: VEHICLE

CODE VTYPE PERKM

101 VOLVO BUS 160

102 AC DELUXE BUS 150

103 ORDINARY BUS 90

105 SUV 40

104 CAR 20

Note:

● PERKM is Freight Charges per kilometer

● VTYPE is Vehicle Type

Table: TRAVEL

NO NAME TDATE KM CODE NOP

101 Janish Kin 2015­11­13 200 101 32

103 Vedika Sahai 2016­04­21 100 103 45

105 Tarun Ram 2016­03­23 350 102 42

102 John Fen 2016­02­13 90 102 40

107 Ahmed Khan 2015­01­10 75 104 2

104 Raveena 2016­05­28 80 105 4

106 Kripal Anya 2016­02­06 200 101 25

Note:

● NO is Traveller Number

● KM is Kilometer travelled

● NOP is number of travellers travelled in vehicle

● TDATE is Travel Date

(i) To display NO, NAME, TDATE from the table TRAVEL in descending order of NO.

36

Ans SELECT NO, NAME, TDATE FROM TRAVEL

ORDER BY NO DESC;

(½ Mark for SELECT NO, NAME, TDATE FROM TRAVEL)

(½ Mark for ORDER BY NO DESC)

(ii) To display the NAME of all the travellers from the table TRAVEL who are

traveling by vehicle with code 101 or 102.

Ans SELECT NAME FROM TRAVEL

WHERE CODE=„101‟ OR CODE=‟102‟; OR

SELECT NAME FROM TRAVEL

WHERE CODE=101 OR CODE=102;

OR

SELECT NAME FROM TRAVEL

WHERE CODE IN („101‟,‟102‟); OR

SELECT NAME FROM TRAVEL

WHERE CODE IN (101,102);

(½ Mark for correct SELECT)

(½ Mark for correct WHERE )

(iii) To display the NO and NAME of those travellers from the table TRAVEL who

travelled between ‘2015‐12‐31’ and ‘2015‐04‐01’.

Ans SELECT NO, NAME from TRAVEL

WHERE TDATE >= „2015-04-01‟ AND TDATE <= „2015-12-31‟; OR

SELECT NO, NAME from TRAVEL

WHERE TDATE BETWEEN „2015-04-01‟ AND „2015-12-31‟; OR

SELECT NO, NAME from TRAVEL

WHERE TDATE <= „2015-12-31‟ AND TDATE >= „2015-04-01‟; OR

SELECT NO, NAME from TRAVEL

WHERE TDATE BETWEEN „2015-12-31‟ AND „2015-04-01‟;

(½ Mark for correct SELECT)

(½ Mark for correct WHERE )

(iv) To display all the details from table TRAVEL for the travellers, who have

travelled distance more than 100 KM in ascending order of NOP.

Ans SELECT * FROM TRAVEL WHERE KM > 100 ORDER BY NOP;

(½ Mark for correct SELECT)

(½ Mark for correct WHERE )

37

(v) SELECT COUNT(*),CODE FROM TRAVEL

GROUP BY CODE HAVING COUNT(*)>1;

Ans COUNT(*) CODE

2 101

2 102

(½ Mark for correct output)

(vi) SELECT DISTINCT CODE FROM TRAVEL;

Ans DISTINCT CODE

101

102

103

104

105

(½ Mark for correct output)

Note: Ignore the order

(vii) SELECT A.CODE,NAME,VTYPE

FROM TRAVEL A,VEHICLE B

WHERE A.CODE=B.CODE AND KM<90;

Ans CODE NAME VTYPE

104 Ahmed Khan CAR

105 Raveena SUV

(½ Mark for correct output)

(viii) SELECT NAME,KM*PERKM

FROM TRAVEL A,VEHICLE B

WHERE A.CODE=B.CODE AND A.CODE=‟105‟;

Ans NAME KM*PERKM

Raveena 3200

(½ Mark for correct output)

6 a. Verify the following using Boolean Laws. 2

A‟+ B‟.C = A‟.B‟.C‟+ A‟.B.C‟+ A‟.B.C + A‟.B‟.C+ A.B‟.C

Ans LHS

A‟ + B‟.C

= A‟.(B + B‟).(C + C‟) + (A + A‟).B‟.C

= A‟.B.C + A‟.B.C‟ + A‟.B‟.C + A‟.B‟.C‟ + A.B‟.C + A‟.B‟.C

= A‟.B.C + A‟.B.C‟ + A‟.B‟.C + A‟.B‟.C‟ + A.B‟.C

= A‟.B‟.C‟ + A‟.B.C‟ + A‟.B.C + A‟.B‟.C + A.B‟.C

= RHS

OR

RHS = A‟.B‟.C‟ + A‟.B.C‟ + A‟.B.C + A‟.B‟.C + A.B‟.C

= A‟.B‟.C + A‟.B‟C‟ + A‟.B.C + A‟.B.C‟ + A.B‟.C

38

= A‟.B‟.(C+C‟) + A‟.B.(C+C‟) + A.B‟.C

= A‟.B‟ + A‟.B + A.B‟.C

= A‟.(B‟+B) +A.B‟.C

= A‟ + A.B‟.C

= (A‟ + A).(A‟ + B‟.C)

= A‟ + B‟.C = LHS

(2 Marks for correct Verification)

OR

(1 Mark for expanding LHS up to 1 correct step)

OR

(1 Mark for reducing RHS up to 1 correct step)

b. Write the Boolean Expression for the result of the Logic Circuit as shown below: 2

Ans ((U + V‟).(U + W)). (V + W‟)

OR

(U + V‟).(U + W). (V + W‟)

(2 Marks for correctly writing the full expression )

OR

(½ Mark each for correctly writing any one term)

c. Derive a Canonical POS expression for a Boolean function F, represented by the 1

following truth table:

P Q R F(P,Q,R)

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Ans F(P,Q,R)=(P+Q+R).(P+Q‟+R‟).(P‟+Q+R).(P‟+Q+R‟)

OR

F(P,Q,R)= ᵴ (0,3,4,5)

(1 Mark for the correctly writing the POS form)

39

Note: Deduct ½ mark if wrong variable names are used

d. Reduce the following Boolean Expression to its simplest form using K‐Map: 3

F(X,Y,Z,W)= (2,6,7,8,9,10,11,13,14,15)

Ans

OR

F(X,Y,Z,W) = XY‟ + ZW‟ + XW + YZ

( ½ Mark for drawing K‐Map with correct variable names)

( ½ Mark each for 4 groupings)

( ½ Mark for writing final expression in reduced/minimal form)

Note: Deduct ½ mark if wrong variable names are written in the

expression

7 (a) Give two examples of PAN and LAN type of networks. 1

Ans

PAN Examples

LAN Examples

Connecting two cell phones to Connecting computers in a school

transfer data

Connecting smartphone to a smart Connecting computers in an office

watch

Note: Any one example of each

OR

Any other one/two correct examples for each of PAN and LAN

( ½ Mark for any one/two correct examples of PAN)

( ½ Mark for any one/two correct examples of LAN)

(b) Which protocol helps us to browse through web pages using internet browsers? 1

Name any one internet browser.

Ans Protocol: HTTP ORTCP/IP

Browser: Chrome OR Internet Explorer OR Firefox OR OPERA OR SAFARI

ORany other correct Browser Name

40

(½ Mark for any one correct protocol name)

(½ Mark for any one correct browser name)

(c) Write two advantages of 4G over 3G Mobile Telecommunication Technologies in 1

terms of speed and services?

Ans

4G 3G

Speed approximately 100 mbps Speed approximately 2 mbps

LTE True mobile broadband Data services with multimedia

OR

Any other two correct advantages of 4G over 3G in terms of speed and

services

( ½ Mark for each correct advantage)

(d) Write two characteristics of Web 2.0. 1

Ans ● Makes web more interactive through online social media

● Supports easy online information exchange

● Interoperability on the internet

● Video sharing possible in the websites

OR

Any two of the above or any other two correct characteristics of Web 2.0

(½ Mark each for any two correct characteristics)

(e) What is the basic difference between Trojan Horse and Computer Worm? 1

Ans

Trojan Horse Computer Worm

It is a "Malware" computer program It is a self‐replicating computer

presented as useful or harmless in program. It uses a network to send

order to induce the user to install and copies of itself to other nodes

run them. (computers on the network) and it

may do so without any user

intervention.

41

OR

Any other correct difference between Trojan Horse and Computer Worm

(1 Mark for writing correct difference between Trojan Horse and

Computer Worm)

OR

(½ Mark for writing correct explanation of Trojan Horse)

OR

(½ Mark for writing correct explanation of Computer Worm)

(f) Categories the following under Client side and Server Side script category? 1

(i) VB Sript

(ii) ASP

(iii) JSP

(iv) Java Script

Ans

Client Side Scripts Server Side Scripts

VB Script ASP

Java Script JSP

(1 Mark for correct answer)

OR

(½ Mark for any two correct client/server side script names)

(g) Uplifting Skills Hub India is a knowledge and skill community which has an aim to

uplift the standard of knowledge and skills in the society. It is planning to setup its

training centers in multiple towns and villages pan India with its head offices in

the nearest cities. They have created a model of their network with a city, a town

and 3 villages as follows.

As a network consultant, you have to suggest the best network related solutions

for their issues/problems raised in (i) to (iv), keeping in mind the distances

between various locations and other given parameters.

42

Shortest distances between various locations:

VILLAGE 1 to B_TOWN 2 KM

VILLAGE 2 to B_TOWN 1.0 KM

VILLAGE 3 to B_TOWN 1.5 KM

VILLAGE 1 to VILLAGE 2 3.5 KM

VILLAGE 1 to VILLAGE 3 4.5 KM

VILLAGE 2 to VILLAGE 3 2.5 KM

A_CITY Head Office to B_HUB 25 Km

Number of Computers installed at various locations are as follows:

B_TOWN 120

VILLAGE 1 15

VILLAGE 2 10

VILLAGE 3 15

A_CITY OFFICE 6

Note:

● In Villages, there are community centers, in which one room has been

given as training center to this organization to install computers.

● The organization has got financial support from the government and top IT

companies.

(i) Suggest the most appropriate location of the SERVER in the B_HUB (out of the 4 1

locations), to get the best and effective connectivity. Justify your answer.

Ans B_TOWN. Since it has the maximum number of computers and is closest to all

other locations.

43

(½ Mark for writing correct location name)

(½ Mark for writing any one correct justification)

(ii) Suggest the best wired medium and draw the cable layout (location to location) to 1

efficiently connect various locations within the B_HUB.

Ans Best Wired Medium : Optical Fibre

(½ Mark for writing the correct best wired medium name)

(½ Mark for drawing the correct cable layout)

(iii) Which hardware device will you suggest to connect all the computers within each 1

location of B_HUB?

Ans Switch OR Hub

(1 Mark for writing any one of the above answers)

(iv) Which service/protocol will be most helpful to conduct live interactions of Experts 1

from Head Office and people at all locations of B_HUB?

Ans Videoconferencing OR VoIP OR any other correct service/protocol

(1 Mark for writing any one of the above answers)

44

KENDRIYA VIDYALAYA SANGATHAN KOLKATA REGION PREBOARD-II EXAMINATION (2017-18)

Marking Scheme Class XII

Informatics Practices ( Code 065 )

Time : 3 Hrs.

1 a) MAC ADDRESS Example-26:A3:21:65:2D:FA

I Mark for unique physical address, 1 mark for example

2

b) In star topology addition of node involves a connection all the way to the single central node through hub/switch which has limited capacity 2 mark for correct answer

2

c) MAN Repeater required to amplify and restore signal other signal degrades in long distance transmission 2 mark for correct answer

2

d) iv. Option i and iii both Snooping refers to the unauthorized access of someone data/email/computer activity or data communication. Casually observing someone else’s email or monitoring activity of someone else’s computer through snooping software etc 1 mark for each correct answer

2

e) Proprietary standard- user has to buy license,standard available under restrictive contract term, user has to pay etc. Ex- .doc,.xls, .ppt,.wma etc Open standard- publicly and Freely available, not require to buy license, no payment, across platform available etc. Ex- .html, .odf,.png, .jpeg etc 1 mark for each correct answer

2

a) 2 1 mark for correct answer

1

b) Focusable 1 mark for correct answer

1

c) Jpassword1.setEchoChar( ‘%’) 1 mark for correct answer

1

d) (iii) float 1 mark for correct answer

1

e) int score=500; Score = score *3; Score = score -250; 2 marks for correct answer

2

f) Missing break statement causing fall through. Insert break statement in each case block at end.

case 11: jTextField2.setText(“Middle term Visa”);

2

g) <table> <tr> <td> Keyboard </td> <td> <img src= “Keyboard.jpg”> </td>

2

45

</tr> <tr> <td> Mouse </td> <td> <img src= “Mouse.jpg”> </td> </tr> </table> 1 mark for each row

Q3. a) Primary key , foreign key, check, default etc ( 1 marks for any two correct constraint)

1

b) Alter table VOTER add primary key(V_ID); 1 mark for correct answer

1

c) Distinct

1 mark for correct answer

1

d) 320 1 mark for correct answer

1

e)

FriendCode Name Hobbies

F01 Bijoy Swimming

F02 Abhinav Dancing

F03 Rohit Drawing

F04 Raghav Cricket

F05 Garima Hand Ball

2 mark for correct answer

2

f) Savepoint- Defines breakpoints for the transaction to allow partial rollback Ex- - - - Savepoint New_Point; Delete from user where roll=5; Select * from user; Rollback To Savepoint New_Point; 1 mark for correct definition 1 mark for example

2

g) Now()- Returns date and time when statement execute Sysdate()- Returns date and time when function executes

2

Q4. a) 75 1 mark for correct answer

1

b)

9 JAVASTUDY vas 8 ½ marks for each answer

2

46

c) P=30 R=34 1 Mark for each correct answer

2

d) total=56 temp=119 2

e) int x, y; for( x=0; x<10; x = x+2) { If (x==4) break ; else y +=x; } Jtextfield.setText( “”+y);

1 mark for for statement ½ for if- else ½ for setText

2

f (i) int total=0; if ( Community .isSelected()) total += 100; if( Swachh.isSelected()) total += 250; if ( Traffic.isSelected()) total += 170; Jtf6.setText(“”+total); (2 mark for correct if statements) (1 mark for display)

(ii) Jtf1.setText(“”); Jtf2.setText(“”); Jtf3.setText(“”); Jtf4.setText(“”); Jtf5.setText(“”); Jtf6.setText(“”); Community .setSelected(false); Swachh.setSelected(false); Traffic.setSelected(false); (1 mark for clearing all text fields) (1 mark for clearing all check box)

(iii) System.exit(0)

6

Q5. a) (i) cardinality =3 degree= 4 (1 mark for correct answer) (ii) cardinality =2 degree= 3 (1 mark for correct answer) (III)(a)INSTR(NAME, ‘o’) (1 mark for correct answer) 5 7 8 (b) SUBSTR(LotNo,3,2) (1 mark for correct answer) AE WE ET

1 1 2

47

b) (i) Select Topic, Date_test from TEST where Grade<20 and Marks>15; (ii) select * from TEST where Date_test > ‘2016-02-15’; (iii) select count(*) from TEST where topic like “C%”; (iv)Update test set marks = marks + 12 where Tno= 105 or Tno=108; (v) max(marks) min(marks) 26 16 (vi) concat(Topic, TNo) Length(Topic) Greenhouse101 10 Methane102 7 Reproduction103 12 (1 mark for each correct answer)

6

Q6. a) Create table REVIEW ( REV_Id integer(5), POINT Decimal(10,2), CONTROL Varchar(30), REV_DATE Date, COMMENT Varchar(100) ); 2 marks for correct answer

2

b) (I) Primary Key- DownloadNo Foreign Key- AppId 1 marks for each (ii) Cartesian product= 16 Equi Join field- AppId 1 marks for each

2 2

c) (i)Select Cust_Name, Phone, Product, Order_Days from CUSTOMER,

ENQUIRY where CUSTOMER. Cust_Id= ENQUIRY. Cust_Id AND RateQuoted<1500;

(2 MARKS FOR CORRECT ANSWER)

(ii) Select Phone, Address, Enq_Num, Order_Days from CUSTOMER, ENQUIRY

where CUSTOMER. Cust_Id= ENQUIRY. Cust_Id AND Address Like “%R%”;

(2 MARKS FOR CORRECT ANSWER)

2 2

Q7. a) 1. In traditional commerce, cost has to be incurred for the role of middlemen to sell the company’s product. The cost incurred on middlemen is eliminated in e-commerce as there is a direct link between the business and the customer. 2. The total overhead cost required to run e-business is comparatively less, compared to traditional business. 3.Use of internet reduces the cost of goods. 4.Access to the international market provides opportunity to compare and analyse the cost. 5. improved customer service

1 marks for any 1 correct answer

1

b) 1. Poor internet connection 2

48

2. Lack of Control Learning Approach

3. Technology Issues

4. Cultural differences obstruct the aim of e-learning

5. The assessments that are computer marked generally have a tendency of being only knowledge-based and not necessarily practicality-based.

6. The authenticity of a particular student's work

7. Isolated

( 2 marks for any two correct point

c) 1. Label 2. Text Area 3. CheckBox /List 4. Radio Button/Combo Box

2

49

KENDRIYA VIDYALAYA SANGATHAN

KOLKATA REGION

PRE-BOARD-I EXAMINATION (2017-18)

CLASS:XII

SUBJECT:COMPUTER SCIENCE MAX

MARKS:70

MARKING SCHEME

General Instructions:

The answers given in the marking scheme are SUGGESTIVE. Examiners are requested to

award marks for all alternative correct solution/answer conveying the similar meaning.

All programming questions have to be answered with respect to C++ language only.

In C++ ignore case sensitivity for the Identifiers (Variable/function/structure/class names).

In SQL related queries both ways of string representation (single quote/ double quote) should

be acceptable.

In SQL related questions, semi colon should be ignored for terminating the SQL statement.

In SQL related questions, ignore case sensitivity

All date format should be accepted

Question 1.

(a) By default parameter, It is meant that if in the time of calling the function required no of

parameters are not passed,the function will work with the default value provided.

int Square( int m, int n=5)

{

int diff;

diff = (pow(m-n),2);

return diff;

}

1 mark for correct definition

1 mark for correct absolute function with parameter

(b) iostream.h, stdlib.h

50

1 mark for correct answer

(c) typedef float interest;

interest calculation( int amt , int rate)

{

interest amt;

amt= amt * rate*0.1;

return amt ;

}

void main( )

{ int r, pr ;

cin >> r;

switch ( r )

{ case 5 : pr = 4000; break ;

default : pr = 6000;

}

cout<< calculation( 3000,5);

}

2 marks for correct answer (1/2 marks for each line of correction

(d) Original String : ASSEMBLE

Changed String :SUSEMBLE

( 1 Mark for each correct line)

(e) 10#5#40*30*

10:5:20:15:

5#15#30*50*

1 mark for each line of output

(f) Low-4 High-7 (I mark for correct answer)

Possible outputs- ii and iv (1 mark for correct answer)

Question 2

(a) Function overloading- functions having same name but different signature within same

scope.

int volume( int l, int b, int h)

{ return l*b*h;

}

float volume ( float r, int h)

{

return 3.14 * r*r*h;

51

}

1 mark for definition, 1 mark for example

(b) (i) planet earth;

1 mark for correct answer

(ii) Statement 1: strcpy(name, obj.name);

Statement 2: strcpy(distance, obj.distance);

1 mark for correct answer

(c) Class SHOW

{int Sno;

char Category[30];

char Location[30];

void FixLocation ( )

{

if (strcmpi(Category, “Musical”)==0)

strcpy(Location , “Agra”);

else if (strcmpi(Category, “Artistic ”)==0)

strcpy(Location , “Lucknow”);

else if (strcmpi(Category, “Drawing ”)==0)

strcpy(Location , “Patna”);

}

public:

void Enter( )

{

cout <<”Enter Show no : “;

cin> Sno;

cout <<”Enter category: “;

gets(Category);

}

void SeeAll( )

{

cout <<” Show no : “<< Sno<<endl;

cout<< “Category :”<< Category<<endl;

cout<<”Location : “<<Location<<endl;

if (Sno== 125)

cout<< “Lucky customer”;

}

};

1 mark for data member

1 mark for each function

(d) (i) Multiple inheritance

(ii) Name, City, Manager, Qty

(iii) Input(), View(), GetIn(), Show()

52

(iv) PRODUCT, WHOLESALER, SHOWROOM

1 mark for each correct answer

Question 3

(a) void CalcHRA(int BasicPay[ ],int N, char City )

{

int i, rate;

float hra;

if (City == „X‟)

rate = 24;

else if(City== „Y‟)

rate=16;

else

rate= 8;

for(int i; i<N; i++)

{

hra= BasicPay[i] * rate*0.01;

cout<< “BasicPay : “<< BasicPay[i] << “HRA : “<< hra;

}

}

1 mark for correct if and calculation of rate

1 mark for loop and calculation of hra

(b) address of T[I][J] = base address + w ( n ( I – Lr) + (J-Lc))

address of T[10][8] = base + 4( 10(10-0) + (8-0))

52000= base + 4( 100 +8)

52000 = base + 4x108

52000 = base + 432

Base = 52000 – 432

Base = 51568

Address of T[15][5] = 51568 + 4( 10 (15-0) +(5-0)

= 51568 + 4(150+5)

= 51568 + 4 x 155

= 51568 + 620

= 52188

11/2 marks for calculation of each address

(c)

void REPEAT_ROW(int A[][3],int R, int C)

{

int i, j ;

53

for( i = 1 ; i< R; i++)

{

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

{

A[i][j]= A[0][j];

}

}

//printing array

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

{

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

{

cout<<A[i][j];

}

cout <<endl;

}

}

2 marks for both loop

1 mark for correct assignment

(d) void STACK :: POP_SEMINAR ( );

{

SEMINAR *ptr;

if( TOP == NULL)

{ cout << “Stack Empty, Underflow “;

}

else

{

ptr = TOP;

Top = TOP-> Link;

54

delete ptr;

}

}

1 mark for checking empty stack

1 mark for assigning TOP to ptr

1 mark for assigning address of next node in TOP

1 mark for delete

(e) 3600

2 marks for correct answer using stack

Question 4.

(a) Total Count:350

New :220

½ marks for each line

(b) void Search()

{

ifstream f( “COMPUTER.TXT”);

char w[30];

int c=0;

while(! f.eof() )

{

f >> w;

if ( w[0]==‟T‟ )

{

c++;

}

}

cout << c;

f.close()

}

½ mark for opening , ½ mark for loop

1 mark for correct checking of not lowercase and counting

(c) void CALSAL( )

{

ifstream f ( “WORKERS.DAT” , ios::binary| ios::in);

WORKER W;

float s=0.0;

while( ! f.eof( ))

{

f.read( (char*) &W, sizeOf(W));

if ( strcmp( W. GetDepartment( ) , “COMPUTER”) ==0)

55

s +=

W.GetSal( );

}

cout<<s;

}

½ mark for

opening data file

½ marks for

loop

1 mark for read and

output

1 marks for correct achecking and adding salary

Question 5

(a) Cartesian Product (1 mark for correct answer)

Primary key= Empno Foreign key= Hno (1 mark for

correct answer )

(b)

i) Select FName, Hiredate, Salary from FACULTY where Salary >10000

order by salary desc;

ii) Select * from FACULTY where Hiredate between „2000-02-10‟ and

„2004-08-11‟;

iii) Select Cname,Fees from courses where not cname „Human Biology‟;

iv) Select Cname , count(*) from courses group by Cname ;

v) count(distinct F_ID)

4

(vi) MIN(Salary)

10000

(vii) F_ID sum(Fees)

102 60000

56

106 31000

104 8000

105 6000

(viii) FName Cname

Rohan Computer Security

Reema Grid Computing

1 mark for each question from i to iv

½ mark for each question from v to viii

Question 6.

(a) LHS = (A‟+B‟). (A+B)

= (A‟+B‟). A + (A‟+B‟). B

= A.A‟ + A.B‟ + A‟.B +B‟.B

= 0 + A.B‟ + A‟B+0

= A.B‟ + A‟B

= RHS

2 marks for correct answer

(b) 2 marks for correct logic circuit diagram.

(c) POS expr for boolean function F(A,B,C) = ( A+B+C). (A+B’+C).(A’+B+C)(A’+B+C’)

1 mark for correct expr

(d) Quad1 = m8+m9+ m12+ m13

Quad2 = m2 + m3 +m10+ m11

Pair1 = m2 + m6

After reduction

Quad1 = UW‟

Quad2= V‟W

Pair1 = U‟WZ‟

Final reduced SOP expr = UW‟ + V‟W + U‟WZ‟

½ mark for correct K-Map box

½ marks correctly putting 1 in K-MAP boxes

½ mark for correct encircle of 2 quads and 1 pair

½ mark for reduction of each three term

57

Question 7

(a) (i) Co-axial cable

Because Thicknet Co-axial can provide the segment length of 500 meter.

1 mark for correct answer

(b) Bus/Linear topology

1 mark for correct answer

(c) (ii)SIP

1 mark for correct answer

(d) (i)GSM- GLOBAL SYSTEM FOR MOBILE COMMUNICATION(ii)XML-

EXTENSIBLE MARKUP LANGUAGE

½ Marks for each correct answer

(e) Cyberlaw

1 mark for correct answer

(f)

(ii) To read the opened email of any person

(iv) To steal the keyboard of any computer

1 mark for correct answer

(g) (i) Programming Block as this block having maximum no. of computer therefore

maximum workload

(ii) switch/hub

(iii) star topology

(h) (iv) (b) CHAT

(1 mark for each correct answer )

WEB DESIGN PROGRAMMING

HR HARDWARE