kendriya vidyalaya sangathan dehradun regionkvhaldwani.org/computersc/1st pre board cs 2015-16...

7
1 KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGION 1 st Pre-Board Examination, 2015-16 Class XII – Computer Science(083) Time: 3 Hours Max. Marks: 70 (Marking Scheme) Q.No Answer Marks 1) a. Post increment operator is placed after the operand eg. a++. The value of operand is first used in the expression for evaluation and then the operand’s value is incremented by 1. Pre increment operator is placed before the operand eg. ++a. The value of operand is first incremented by 1 and then used in the expression for evaluation. Example: Any one correct example with explanation for both 2 (1 Mark for correct difference & 1 mark for example) 1) b. string.h stdio.h 1 Mark for mentioning name of each header file) 1) c. #include <iostream.h> const int N=5; void doIT (int &, int &); void main( ) { int i , age[N]={20,50,10,30,40} ; for (i=0;i<N/2; i++) doIT(age[i],age[N-i-1]); for (i=0; i<N; i++) cout<<age[i]<<endl; } void doIT(int &X,int &Y) { int temp=X; X=Y; Y=temp; } 2 (½ Mark for mentioning each error) 1) d. SwachHBharaT wachHBharAT achHBhaRAT chHBhARAT 2 Mark for each correct line of output) 1) e. 3@5@7@ 3#15# 21#27# 3 (1 Mark for each correct line of output) 1) f. Trick Min Value=0, Max Value=2 i) and iii) 2 (1 Mark for Max and Min Value) Mark for each correct option) 2) a. A class binds together data and associated functions under one unit thereby enforcing encapsulation. A class groups its members into three sections: private, protected and public. The private and protected members remain hidden from outside world, thereby class enforces data 2 (1 Mark for correct definition & 1 mark for example)

Upload: ngotram

Post on 21-Mar-2018

222 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

1

KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGION

1st Pre-Board Examination, 2015-16 Class XII – Computer Science(083)

Time: 3 Hours Max. Marks: 70

(Marking Scheme)

Q.No Answer Marks 1) a. Post increment operator is placed after the operand eg. a++. The

value of operand is first used in the expression for evaluation and then the operand’s value is incremented by 1. Pre increment operator is placed before the operand eg. ++a. The value of operand is first incremented by 1 and then used in the expression for evaluation. Example: Any one correct example with explanation for both

2 (1 Mark for correct difference & 1 mark for example)

1) b. string.h stdio.h

1 (½ Mark for mentioning name of each header file)

1) c. #include <iostream.h> const int N=5; void doIT (int &, int &); void main( ) { int i, age[N]={20,50,10,30,40}; for (i=0;i<N/2; i++) doIT(age[i],age[N-i-1]); for (i=0; i<N; i++) cout<<age[i]<<endl; } void doIT(int &X,int &Y) { int temp=X; X=Y; Y=temp; }

2 (½ Mark for mentioning each error)

1) d. SwachHBharaT wachHBharAT achHBhaRAT chHBhARAT

2 (½ Mark for each correct line of output)

1) e. 3@5@7@ 3#15# 21#27#

3 (1 Mark for each correct line of output)

1) f. Trick Min Value=0, Max Value=2 i) and iii)

2 (1 Mark for Max and Min Value) (½ Mark for each correct option)

2) a. A class binds together data and associated functions under one unit thereby enforcing encapsulation. A class groups its members into three sections: private, protected and public. The private and protected members remain hidden from outside world, thereby class enforces data

2 (1 Mark for correct definition & 1 mark for example)

Page 2: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

2

hiding. Example: Any one correct example

2) b. i) Funtion 3 i.e. Copy Constructor as here the values of one object P1 is passes into another object P2 of same type. ii) Function-2 referred as Parameterized constructor For calling function F2- patient P3(“Dengue”,20);

2 (1 Mark for correctly answering to each part.)

2) c. class DEPARTMENTAL { private: char prod_name [40], dis_type; double list_price, disc_price, net_price; void cal_price( ) { if (dis_type= =‘N’) { if(strcmp(prod_name, “printer”)==0) disc_price= 0.10*8000; else if(strcmp(prod_name, “laptop”)==0) disc_price= 0.10*32000; else if(strcmp(prod_name, “desktop”)==0) disc_price= 0.10*24000; } else if(dis_type= =‘F’) { if(strcmp(prod_name, “printer”)==0) disc_price= 0.10*8000 + 0.05*8000*0.9; else if(strcmp(prod_name, “laptop”)==0) disc_price= 0.10*32000 + 0.05*32000*0.9; else if(strcmp(prod_name, “desktop”)==0) disc_price= 0.10*24000 + 0.05*24000*0.9; } net_price= list_price- disc_price; } public: DEPARTMENTAL ( ) { strcpy(prod_name, “NULL”); dis_type= ‘N’; list_price= disc_price= net_price=0; } void allow( ) { gets(prod_name); cin>> list_price >> dis_type; cal_price( ); } void show( ) { cout<< prod_name << list_price << dis_type << disc_price<< net_price; } };

4 (½ Mark each for data members and constructor) (1 Mark for each function definition allow and show) (2 Mark for function definition calc_price)

2) d. i) Multiple inheritance ii) 213 bytes iii) Data members- channel, pkgcost, dactors, rparticipants. iv) Data members- dactors. Member functions- enterserial( ), displayserial( ), enterdrama( ), displaydrama( ).

4 (1 Mark for each correct answer.) No marks to be given for partial answers

Page 3: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

3

3) a. void Get2From1( int ALL[ ],int N) { int Odd[ ], Even[ ], j=0, k=0;

for(int i=0;i<N;i++) { if (i%2==0) { Even[j]=ALL[i];

j++; }

else {

Odd[k ]=ALL[i]; k++; }

} }

3 ( ½ Mark for function header with desired parameters) ( ½ Mark initialising counters in loop) (1 Mark for correct transfer in Even) (1 Mark for correct transfer in Odd)

3) b. Given, W=4 Nc=Uc- Lc +1 = 15-(-2)+1=18 Address(AR[2][2])=1000 Row Major Formula: Address (AR[I][J]) = B + W [Nc (I - Lr ) + ( J- Lc )] Address (AR[2][2])= B + 4 [ 18(2 + 1 ) + ( 2+2)] 1000 = B + 4 [ 54 + 4] B= 1000-232=768 Address (AR[20][5])= 768 + 4 [ 18(20 + 1 ) + ( 5+2)] =768 + 4[ 378+ 7] = 768 + 1540= 2308

3 (1 Mark for correct formula/substitution of values in formula) (1 Mark for correctly calculating Base Address) (1 Mark for correctly calculating address of desired location)

3) c. void Insert( ) { City *ptr = new City; cout<<”Enter Population”; cin>>ptr-> population; cout<<”Enter Cityname”; gets(ptr-> cityname); ptr->Link=NULL; if (rear = = NULL) front= rear= ptr; else { rear->Link = ptr; rear= ptr; } }

4 ( ½ Mark for appropriate function header) ( ½ Mark for declaring a Temporary pointer - ptr) (1 Mark for input values) (1 Mark for correct condition) (1 Mark for correct statements)

3) d. int AddEnd3 (int A [ ][3], int M, int N) { int i, j, sum= 0; for (i=0; i<M; ++i) { for (j=0; j<N; j++) { if(A[i][j]%10==3) sum= sum + A[i][j]; } } cout<< sum; }

2 ( ½ Mark for function header with desired parameters) ( ½ mark for correct formation of loop) (½ Mark for correct condition) (½ Mark for correct output format)

Page 4: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

4

3) e. (A + B) * (C ^ (D – E) + F) - G * H = AB+ * (C ^ DE- + F) – G * H = AB+ * (CDE-^ + F) – G * H = AB+ * CDE-^F+ – G * H =AB+ CDE-^F+* - GH* = AB+ CDE-^F+*GH*-

2 ( 1½ Mark for each line two conversion)

4) a. File.seekp((Record)*sizeof(P)); //statement1 Or File.seekp(-1*sizeof(P),ios::cur); File.write((char*)&P, sizeof(P)); //statement2

1 ( ½ Mark for each correct statement)

4) b. void countword4( ) { ifstream fin; fin.open(“NOTES.TXT”); char word[20]; int count=0; while (!fin.eof( )) { fin>>word; if (strlen(word)==4) count++; } cout<<”No of word=”<<count; fin.close(); }

2 (½ mark for correct syntax of function header and opening the file in ‘in’ mode) ( ½ mark for reading content from file) ( ½ mark for correct condition for searching) (½ mark for displaying the result)

4) c. void PhoneSearch( ) { ifstream fin; fin.open(“PHONES.DAT”,ios::binary|ios::in); PHONE P; int Found=0; while (!fin.eof( )) { fin.read((char*)&P,sizeof(P)); if (P. GetCalls ( ) >800) { P.Billing ( ); Found++; break; } } if (Found==0) cout<<”Sorry! Phone not found!!!”<<endl; fin.close(); }

3 (½ mark for correct syntax of function header and body) ( ½ mark for opening the file in ‘in’ mode) ( ½ mark for reading content from file into the object of P) ( ½ mark for appropriate loop) ( ½ mark for correct condition for searching) ( ½ mark for displaying the content of the object)

5) a. Candidate key- All attributes combinations inside a relation that can serve as primary key are Candiadate keys as they are candidates for the Primary Key position. Primary key- It is a set of one or more attributes that can uniquely identify tuples within the relation. Eg. A table STUDENT having columns rollno, regno, name, class, percentage. In which, columns rollno and regno are candidate key as they are candidates for the Primary Key position. But we can declare any column as primary key because both uniquely identify tuples within the relation.

2 (1 mark for each correct definition and 1 mark for correct example)

5) b. i) select Ord_Id, Item, Qty, Price, Qty*Price as “Bill_Amount” from BILL;

6 (1 mark for each correct query) ( ½ mark for each

Page 5: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

5

ii) select sum(Qty) from BILL where Item=”Pizza” and Ord_date>“02-03-15”; iii) select * from CLIENT where City IN (“Delhi”,”Bangalore”) order by Cust_Id desc; iv) update BILL set Qty=Qty + 50 where Qty<10; v) Cust_Name City Item Anurag Basu Kolkata Ice Cream Vinod Nagpal Mumbai Ice Cream vi) sum(price) 748.50 vii) City count(*) Bangalore 3 Delhi 3 Kolkata 1 Mumbai 2 viii) (distinct item) Pizza Garlic Bread Pasta Ice Cream Brownie

correct output)

6) a. De-Morgan First Theorem (X+Y)’= X’.Y’ Let X+Y= P Then P’=X’Y’ By Complementarity law P + P’=1 ---- (i) P.P’=0 ----- (ii) Putting values of P and P’ in equation (i) (X+Y) + X’Y’=1 LHS=(X+Y+X’)(X+Y+Y’) [By distributive law] =(Y+1)(X+1) =1.1 =1= RHS Putting values of P and P’ in equation (ii) (X+Y)(X’Y’)=0 LHS= XX’Y’ + YX’Y’ = 0.Y’+ 0.X’ =0+0=0=RHS Hence proved

2 (1 mark for stating the correct law that used) (1 mark for the appropriate verification using algebraic method)

6) b. F= (U’+V).(V’+W) Full 2 marks for obtaining the correct Boolean Expression for the Logic Circuit

6) c. F(X,Y,Z)= π (1,3,4,6,7) F(X,Y,Z)= Σ(0,2,5) F=000 + 010 + 101 F=X’Y’Z’ + X’YZ’ + XY’Z

(1 mark for correct SOP representation)

Page 6: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

6

6) d. C’D’ C’D CD CD’

A’B’ 0

1 1

1 3

1 2

A’B 4

1 5

1 7

1 6

AB 1 12

1 13

1 15

14

AB’

8 1

9 1

11

10 F(A,B,C,D)= (D) + (A’C) + (ABC’)

(1 mark for correctly drawing K-Map with 1s represented on right places) (1 mark for minimizing each Octet, Quad and Pair) (1 mark for writing the complete Boolean Expression)

7) a. A system designed to prevent unauthorized access to or from a

private network is called firewall. 1 Mark for correct definition

7) b. IP address is a numerical identification and logical address that is assigned to a devices connected in a computer network which is used to uniquely identify devices on the Internet. Eg. 192.168.1.136

1 (½ Mark for correct definition and example each)

7) c. Software whose source code is available to the customer and it can be modified and redistributed without any limitation. OSS may come free of cost or with a payment of nominal charges in the name of charge of support and development of software. Eg. Linux/Unix

1 (½ Mark for correct definition and example each)

7) d. (ii) Stealing a keyboard and mouse from a shop.

1 Mark for correct option

7) e. A protocol means the set of rules that two or more devices must follow to exchange the information over a network. Eg. Internet protocol

1 (½ Mark for correct definition and example each

7) f. XML- eXtensible Markup Language GPRS- General Packet Radio Service

1 (½ Mark for each correct expansion)

7) g. (i) Layout Option 1: Star topology

(1 mark for any of the correct Layout)

BLOCK A

BLOCK C

BLOCK B

BLOCK D

Page 7: KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGIONkvhaldwani.org/computersc/1st Pre Board CS 2015-16 (MS).pdf · kendriya vidyalaya sangathan . dehradun region . 1. ... transfer in odd)

7

7) g. ii) BLOCK C is the suitable place to house the server

of organization as it has maximum no of computers and it reduces the cabling cost

1 (½ Mark for correct answer and reason each)

iii) a) Modem in BLOCK C as it has maximum no of computers & this block is suitable for server position. b) Switch in all the four BLOCKS to connect all the computers with each other.

1 (½ Mark for each correct answer)

iv) Radiowave is a economic way to connect it in a hilly region where cable connection is not feasible

1 (1 Mark for correct answer)