KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGION st Pre-Board Examination, 05-6 Class XII Computer Science(08) Time: Hours Max. Marks: 70 (Marking Scheme) Q.No Answer Marks ) 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. Pre increment operator is placed before the operand eg. ++a. The value of operand is first incremented by and then used in the expression for evaluation. Example: Any one correct example with explanation for both ) b. string.h stdio.h ) c. #include <iostream.h> const int N=5; void doit (int &, int &); void main( ) int i, age[n]=0,50,0,0,0; for (i=0;i<n/; i++) doit(age[i],age[n-i-]); for (i=0; i<n; i++) cout<<age[i]<<endl; void doit(int &X,int &Y) int temp=x; X=Y; Y=temp; ) d. SwachHBharaT wachhbharat achhbharat chhbharat ) e. @5@7@ #5# #7# ) f. Trick Min Value=0, Max Value= i) and iii) ) 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 ( Mark for correct difference & mark for example) mentioning name of each header file) mentioning each error) each correct line of output) ( Mark for each correct line of output) ( Mark for Max and Min Value) each correct option) ( Mark for correct definition & mark for example)
hiding. Example: Any one correct example ) b. i) Funtion i.e. Copy Constructor as here the values of one object P is passes into another object P of same type. ii) Function- referred as Parameterized constructor For calling function F- patient P( Dengue,0); ) c. class DEPARTMENTAL private: char prod_name [0], 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.0*8000; else if(strcmp(prod_name, laptop )==0) disc_price= 0.0*000; else if(strcmp(prod_name, desktop )==0) disc_price= 0.0*000; else if(dis_type= = F ) if(strcmp(prod_name, printer )==0) disc_price= 0.0*8000 + 0.05*8000*0.9; else if(strcmp(prod_name, laptop )==0) disc_price= 0.0*000 + 0.05*000*0.9; else if(strcmp(prod_name, desktop )==0) disc_price= 0.0*000 + 0.05*000*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; ; ) d. i) Multiple inheritance ii) bytes iii) Data members- channel, pkgcost, dactors, rparticipants. iv) Data members- dactors. Member functions- enterserial( ), displayserial( ), enterdrama( ), displaydrama( ). ( Mark for correctly answering to each part.) (½ Mark each for data members and constructor) ( Mark for each function definition allow and show) ( Mark for function definition calc_price) ( Mark for each correct answer.) No marks to be given for partial answers
) a. void GetFrom( int ALL[ ],int N) int Odd[ ], Even[ ], j=0, k=0; for(int i=0;i<n;i++) if (i%==0) Even[j]=ALL[i]; j++; else Odd[k ]=ALL[i]; k++; ) b. Given, W= N c =U c - L c + = 5-(-)+=8 Address(AR[][])=000 Row Major Formula: Address (AR[I][J]) = B + W [N c (I - L r ) + ( J- L c )] Address (AR[][])= B + [ 8( + ) + ( +)] 000 = B + [ 5 + ] B= 000-=768 Address (AR[0][5])= 768 + [ 8(0 + ) + ( 5+)] =768 + [ 78+ 7] = 768 + 50= 08 ) 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; ) d. int AddEnd (int A [ ][], 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]%0==) sum= sum + A[i][j]; cout<< sum; function header with desired parameters) ( ½ Mark initialising counters in loop) ( Mark for correct transfer in Even) ( Mark for correct transfer in Odd) ( Mark for correct formula/substitution of values in formula) ( Mark for correctly calculating Base Address) ( Mark for correctly calculating address of desired location) appropriate function header) declaring a Temporary pointer - ptr) ( Mark for input values) ( Mark for correct condition) ( Mark for correct statements) function header with desired parameters) correct formation of loop) correct condition) correct output format)
) 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*- ) a. File.seekp((Record)*sizeof(P)); //statement Or File.seekp(-*sizeof(P),ios::cur); File.write((char*)&P, sizeof(p)); //statement ) b. void countword( ) ifstream fin; fin.open( NOTES.TXT ); char word[0]; int count=0; while (!fin.eof( )) fin>>word; if (strlen(word)==) count++; cout<< No of word= <<count; fin.close(); ) 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(); 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. 5) b. i) select Ord_Id, Item, Qty, Price, Qty*Price as Bill_Amount from BILL; each line two conversion) each correct statement) (½ mark for correct syntax of function header and opening the file in in mode) reading content from file) correct condition for searching) (½ mark for displaying the result) (½ mark for correct syntax of function header and body) opening the file in in mode) reading content from file into the object of P) appropriate loop) correct condition for searching) displaying the content of the object) ( mark for each and mark for correct example) 6 ( mark for each correct query) each
ii) select sum(qty) from BILL where Item= Pizza and Ord_date> 0-0-5 ; iii) select * from CLIENT where City IN ( Delhi, Bangalore ) order by Cust_Id desc; iv) update BILL set Qty=Qty + 50 where Qty<0; v) Cust_Name City Item Anurag Basu Kolkata Ice Cream Vinod Nagpal Mumbai vi) sum(price) 78.50 vii) City count(*) Bangalore Delhi Kolkata Mumbai viii) (distinct item) Pizza Garlic Bread Pasta Ice Cream Brownie 6) a. De-Morgan First Theorem (X+Y) = X.Y Let X+Y= P Then P =X Y By Complementarity law Ice Cream P + P = ---- (i) P.P =0 ----- (ii) Putting values of P and P in equation (i) (X+Y) + X Y = LHS=(X+Y+X )(X+Y+Y ) [By distributive law] =(Y+)(X+) =. == 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 correct output) ( mark for stating the correct law that used) ( mark for the appropriate verification using algebraic method) 6) b. F= (U +V).(V +W) Full marks for 6) c. F(X,Y,Z)= π (,,,6,7) F(X,Y,Z)= Σ(0,,5) F=000 + 00 + 0 F=X Y Z + X YZ + XY Z obtaining the correct Boolean Expression for the Logic Circuit ( mark for correct SOP representation) 5
6) d. A B A B AB AB C D C D CD CD 0 8 5 9 7 6 5 0 F(A,B,C,D)= (D) + (A C) + (ABC ) ( mark for correctly drawing K-Map with s represented on right places) ( mark for minimizing each Octet, Quad and Pair) ( 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. 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. 9.68..6 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 Mark for and example each) and example each) 7) d. (ii) Stealing a keyboard and mouse from a shop. 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 7) f. XML- extensible Markup Language GPRS- General Packet Radio Service and example each each correct expansion) 7) g. (i) Layout Option : Star topology BLOCK A BLOCK C BLOCK B BLOCK D ( mark for any of the correct Layout) 6
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 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. iv) Radiowave is a economic way to connect it in a hilly region where cable connection is not feasible correct answer and reason each) each correct answer) ( Mark for correct answer) 7