0% found this document useful (0 votes)
26 views

Computer Science: Sample Paper - 2011 Class - XII Subject - Time: 3 HR M.M 70

This document contains a sample paper for Class XII Computer Science subject. It includes 6 questions with multiple subparts covering topics such as C++ programming, OOPs concepts, SQL queries, Boolean algebra, and more. For example, question 1 has subparts asking to define preprocessors, find outputs of C++ programs, define classes and functions. Question 5 asks to differentiate between DDL and DML commands in SQL and write queries on book publishing tables.

Uploaded by

Chris Macman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Computer Science: Sample Paper - 2011 Class - XII Subject - Time: 3 HR M.M 70

This document contains a sample paper for Class XII Computer Science subject. It includes 6 questions with multiple subparts covering topics such as C++ programming, OOPs concepts, SQL queries, Boolean algebra, and more. For example, question 1 has subparts asking to define preprocessors, find outputs of C++ programs, define classes and functions. Question 5 asks to differentiate between DDL and DML commands in SQL and write queries on book publishing tables.

Uploaded by

Chris Macman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

http://www.cbseguess.

co m/
Sample Paper 2011 Class XII Subject - Computer Science Time : 3 hr M.M 70

Q1 (a) (b)

Define the # define with a suitable example. [2] Write the names of the header files to which the following belong: [1] (i) random ( ) (ii) isalnum ( )

(c) Rewrite the following program after removing the syntactical errors (if any).Underline each correction. [2] #include <iostream.h> struct Pixels { int Color,Style; } void ShowPoint(Pixels P) { cout<<P.Color,P.Style<<endl; } void main() { Pixels Point1=(5,3); ShowPoint(Point1); Pixels Point2=Point1;
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
Color.Point1+=2; ShowPoint(Point2); } (d) Find the output of the following program: [3] #include <iostream.h> void Changethecontent(int Arr[ ], int Count) { for (int C=1;C<Count;C++) Arr[C-1]+=Arr[C]; } void main() { int A[]={3,4,5},B[]={10,20,30,40},C[]={900,1200}; Changethecontent(A,3); Changethecontent(B,4); Changethecontent(C,2); for (int L=0;L<3;L++) cout<<A[L]<<'#'; cout<<endl; for (L=0;L<4;L++) cout<<B[L] <<'#'; cout<<endl; for (L=0;L<2;L++) cout<<C[L] <<'#'; } (e) Find the output of the following program: [2] #include <iostream.h>
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
struct Game { char Magic[20];int Score; }; void main() { Game M={"Tiger",500}; char *Choice; Choice=M.Magic; Choice[4]='P'; Choice[2]='L'; M.Score+=50; cout<<M.Magic<<M.Score<<endl; Game N=M; N.Magic[0]='A';N.Magic[3]='J'; N.Score-=120; cout<<N.Magic<<N.Score<<endl; } (f) In the following program, if the value of N given by the user is 20, what maximum and minimum values the program could possibly display? [2] #include <iostream.h> #include <stdlib.h> void main() { int N,Guessnum;
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
randomize(); cin>>N; Guessnum=random(N-10)+10; cout<<Guessnum<<endl; } Q2.(a) What do you understand by Polymorphism? Give a suitable example of the same. [2] (b) Answer the questions (i) and (ii) after going through the following class: [2] class Match { int Time; public: Match() //Function 1 { Time=0; cout<<"Match commences"<<end1; } void Details() //Function 2 { cout<<"Inter Section Basketball Match"<<end1; } Match(int Duration) //Function 3 { Time=Duration;
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
cout<<"Another Match begins now"<<end1; } Match(Match &M) //Function 4 { Time=M.Duration; cout<<"Like Previous Match "<<end1; } }; (i) using it? (ii) Which category of constructor - Function 4 belongs to and what is the purpose of Write statements that would call the member Functions 1 and 3

------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/

(c)

Define a class named Cricket in C++ with the following descriptions : [4] private members Target_scope Overs_bowled Extra_time Penalty int int int int

cal_panalty() a member function to calculate penalty as follows : if Extra_time <=10 , penalty =1 if Extra_time >10 but <=20, penalty =2 otherwise, penalty =5 public members a function extradata() to allow user to enter values for target_score,overs_bowled , extra_time. a function dispdata() to follow user to view the contents of all data members. (d) Answer the questions (i) to (iv) based on the following: [4] class MNC { char Cname[25]; protected : char Hoffice[25]; public : MNC(); char Country[25]; void Enterdata();
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
void displaydata(); }; class Branch :public MNC { long NOE; char ctry[25]; protected : void Association (); public : Branch(); void add(); void show(); }; class outlet :public branch { char state[25]; public: outlet(); void enter(); void output(); }; 1. Which classs constructor will be called first at the time of declaration of an object of class outlet? 2. How many bytes does an object belonging to class outlet require? 3. From the following , which can not be called directly from the object of class outlet : void Association(); void enter(); void show();

------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
4. If the class MNC is inherited by using protected visibility mode, then name the members which are accessible through the functions of outlet class.

Q3. (a) Given an array named A with following elements 3,-5,1,3,7,0,-15,3,-7,-8 write a C++ function to shift all the
negative numbers to le ft so that the resultant array may look like -5,-15,-7,-8,3,1,3,7,0,3 [3]

(b) Write a function in C++ which accepts an integer array and its size as argument / parameters and assign the
elements into a two dimensional array of integers in the following format. If the array is 1 2 3456 [2] 123456 123450 123400 123000 120000 100000

(c) An array P[20][15] 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][10] is stored at the memory location 5500. [3]

(d) Consider the following portion of a program which implements passengers Queue for a bus.
Write the definition of function Insert( ) to insert a new node in the queue with required information. [4] struct Node { float U,V;
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
Node *Link; }; class QUEUE { Node *Rear, *Front; Public: QUEUE( ) { Rear =NULL; Front= NULL;} Void INSERT ( ); Void DELETE ( ); ~QUEUE ( ); }; (e)

Evaluate the following postfix notation of expression using stack [2] A+B*(P+Q)^C/D

Q4.(a) Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg() and tellg() functions for performing the required task. [1] #include <fstream.h> class Employee { int Eno;char Ename[20]; public: //Function to count the total number of records int Countrec(); }; int Item::Countrec()
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
{ fstream File; File.open("EMP.DAT",ios::binary|ios::in); ______________________ //Statement 1 - To take the file pointer to the end of file. int Bytes =______________________ //Statement 2- To return total number of bytes from the beginning of file to the file pointer. int Count = Bytes / sizeof(Item); File.close(); return Count; } (b) Write a function in C++ to count the number of alphabets present in a text file "NOTES.TXT". [2] (c) Write a function in C++ to add new objects at the bottom of a binary file "STUDENT.DAT", assuming the binary file is containing the objects of thefollowing class. [3] class STUD { int Rno; char Name[20]; public: void Enter(){cin>>Rno;gets(Name);} void Display(){cout<<Rno<<Name<<endl;} }; Q5. (a) [2] Differentiate between DDL and DML commands in SQL.

(b) Write the SQL commands for (i) to (iv) and outputs for (v) to (viii) on the basis of tables
------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
BOOKS and ISSUES. [6]

Table: BOOKS Book_ID L01 L02 L03 L04 L05 L06 BookName Maths Science Social Computer Telugu English AuthorNa me Raman Agarkar Suresh Sumita Nannayya Wordswort h Publisher ABC DEF XYZ ABC DEF DEF Price 70 90 85 75 60 55 Qty 20 15 30 7 25 12

Table: ISSUES Book_ID L02 L04 L05 Qty_Issued 13 5 21

(i) To show Book name, Author name and Price of books of ABC publisher. (ii) To display the details of the books in descending order of their price. (iii) To decrease the Qty_Issued from ISSUES table by 3 (all rows must decrease). (iv) To display the Book Id, Book name, Publisher, Price, Qty, Qty_Issued from both the tables with their matching Book ID. (v) SELECT sum(price) FROM Books WHERE Publisher = DEF; (vi)SELECT Publisher, min(price) FROM Books GROUP BY Publisher; (vii)SELECT Price from Books, Issues where Books.Book_ID=Issues.Book_ID AND Qty_Issued=5; (viii)SELECT Count(Distinct Publisher) FROM Books;

------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
Q6. (a) State and algebraically verify Absorption Laws. (b) Write the equivalent Boolean expression for the following logic circuit. [2] [1]

(c) Write the equivalent canonical POS expression for the following SOP expression: [2] F(x,y,z)=(0,2,5,6). (d) [3] F(A,B,C,D)= (0,1,3,4,7,8,11,12,15); Q7. (a) How firewall protect our Network? (b) Expand the following terminologies: (i) XML (ii) URL [2] [1] [1] Reduce the following Boolean expression using the K-map.

(c) What is a topology? Write short note on Bus topology. (d) Knowledge Supplement Organization has set up its new center at Mangalore for its office and web based activities. It has 4 blocks of buildings as shown in the diagram below:

Block C

Block A

Block B

------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

Block D

http://www.cbseguess.co m/

Center to center distances between various blocks Black A to Block B Block B to Block C Block C to Block D Block A to Block D Block B to Block D Block A to Block C 50 m 150 m 25 m 170 m 125 m 90 m Black A Block B Block C Block D

Number of Computers

25 50 125 10

1)

Suggest a cable layout of connections between the blocks. [1]

2) Suggest the most suitable place (i.e. block) to house the server of this organization with a suitable reason. [1] 3) [1] Suggest the placement of the following devices with justification (i) Repeater (ii) Hub/Switch 4) The organization is planning to link its front office situated in the city in a hilly region where cable connection is not feasible, suggest an economic way to connect it with reasonably high speed? [1]

(e) Define the following terms [2]


------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

http://www.cbseguess.co m/
(i) Freeware (ii) Shareware (iii) Open Source Software (iv) GNU Paper Submitted By: Name Amit kumar singhal Email [email protected]

------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

You might also like