CBSE Computer Science sample paper4 class XII 2008

Add to Favourites
Post to:

http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com Sample Paper -2008 Class – XII Subject -Computer Science Time allowed : 3 Hours Maximum Marks : 70 Note (i) All questions are compulsory. (ii) Programming Language : C++ 1. (a) Define any two features of OOPs. Also give suitable example in C++. 2 2. (b) Name the Header file(s) that shall be needed for successful compilation of the following C++ code void main() { int a[10]; for(int i=0;i<10;i++) { cin>>a[i]; if(a[i]%2==0) a[i]=pow(a[i],3); else a[i]=sqrt(a[i]); if(a[i]>32767) exit(0); } getch(); } 1 (c) Rewrite the following program after removing syntactical error(s) if any. Underline each correction. 2 #include type def int integer; struct number { integer a [5]; } void main() { number x; for(int i=0;i<5;i++) cin>>x[i].a; getch(); } (d) Find the output of the following program : 2 http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com #include #include void main() { char *a[2]={”Amit”,”Sumit”}; for(int i=0;i<2;i++) { int l=strlen(a[i]); for(int j=0;j class student { public: student() { cout<<”\n Computer Science“; } ~student() { cout<<” subject”; } }st; void main() { cout<<” is my best“ } (f) In the following C++ program , what will the maximum and minimum value of r generated with the help of random function. 2 #include #include void main() { int r; randomize(); http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com r=random(20)+random(2); cout< Name : Address :

Marks : <….subject 5 marks> Percentage : Also create main() function which will invoke all the public member functions. (d) Answer the questions (i) to (iv) based on the following code : 4 class Employee http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com { int id; protected : char name[20]; char doj[20]; public : Employee(); ~Employee(); void get(); void show(); }; class Daily_wager : protected Employee { int wphour; protected : int nofhworked; public : void getd(); void showd(); }; class Payment : private Daily_wager { char date[10]; protected : int amount; public : Payment(); ~Payment(); void show(); }; (i) Name the type of Inheritance depicted in the above example. (ii) Name the member functions accessible through the object of class Payment. (iii) From the following, Identify the member function(s) that can be called directly from the object of class Daily_wager class show() getd() get() (iv) Name the base & derived class of Daily_wager class. 3. (a) Write a function in C++ which accepts a integer array and its size as an arguments and prints the output (using nested loops) in following format : http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com Example : if the array is having 1 2 4 5 9 Then the output should be 1 2 2 4 4 4 4 5 5 5 5 5 9 9 9 9 9 9 4 (b) An array A[10][20] is stored in the memory with each element occupying 2 bytes of storage. If the Base address of array in the memory is 800 , determine the location of A[9][10] when the array is stored as (i) Row Major (ii) column major. (c) Write a function in C++ to delete a node containing names of student , from a dynamically allocated Queue of names implemented with the help of following structure : 3 struct student { char name[20]; student *next; }*front , *rear; (d) Consider the following portion of a program , which implements a linked stack for Library . Write the definition of function PUSH(),to insert a new node in the stack with required information 3 struct Library { int id; char names[20]; }; class stack { Library *top; public : stack() { top=NULL; } void PUSH(); void POP(); }; (e) Convert the following infix expression into postfix. show the stack status after execution of each operation: 2 TRUE OR FALSE AND NOT FALSE OR FALSE http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com 4. (a) Differentiate between ios::app and ios::ate file opening modes. (b) Write a function in C++ which will print the size of a text file “story.txt” in the form of bytes. 2 (c) Write a function in C++ which will increase the qty of a particular type of item from the file “stock.dat” . Assuming that the binary file is containing the records of following structure : 3 struct Products { int id; char Iname[30]; int type; int qty; }; Accept the item type from user whose qty has to be increased . 5. (a) What do you understand by Primary Key. 2 (b) Consider the following tables Employee and salary. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) 6 Table : Employee Eid Name Deptid Qualification Sex 1 Deepali Gupta 101 MCA F 2 Rajat Tyagi 101 BCA M 3 Hari Mohan 102 B.A M 4 Harry 102 M.A M 5 Sumit Mittal 103 B.Tech M 6 Jyoti 101 M.Tech F Table : Salary Eid Basic DA HRA Bonus 1 6000 2000 2300 200 2 2000 300 300 30 3 1000 300 300 40 4 1500 390 490 30 5 8000 900 900 80 6 10000 300 490 89 (i) To display the frequency of employees department wise. (ii) To list the names of those employees only whose name starts with „H‟ (iii) To add a new column in salary table . the column name is total_sal. (iv) To store the corresponding values in the total_sal column. (v) Select name from employee where eid=(select eid from salary where basic= (select max(basic) from salary)); (vi) select max(basic) from salary where bonus >40; (vii) Select count(*) from employee group by sex; http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com (viii) select Distinct deptid from Employee; 6. (a) State and prove the Distributive law algebraically. 2 (b) Write the equivalent POS expression of following SOP form F (x,y,z)= ∑ (0,2,4,6) 2 (c) Draw the Logical circuit of the following expression with the help of NAND gate only 1 x+yz (d) Obtain the simplified form of a Boolean expression using K-Map. F(a,b,c,d)=∑(0,1,2,3,4,7,11,12,14) 3 7. (a) What do your understand by Hackers? 1 (b) Differentiate between Internet & Intranet 1 (c) Expand the following terminology : (i) SMS (ii) FTP 1 (d) Define Repeater. 1 (e) A company in Reliance has 4 wings of buildings as shown in the diagram: Center to center distances between various Buildings: W3 to W1 50m W1 to W2 60m W2 to W4 25m W4 to W3 170m W3 to W2 125m W1 to w4 90m Number of computers in each of the wing: W1 150 W1 W2 W3 W4 http://www.cbseguess.com/-------------------------------------------------------------------------------------------------------www.cbseguess.com Other Educational Portals www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com W2 15 W3 15 W4 25 Computers in each wing are networked but wings are not networked. The company has now decided to connect the wings also. i) Suggest a most suitable cable layout & topology of the connection between the wings. [1] ii) The company wants internet accessibility in all the wings. Suggest an economic technology . [1] iii) Suggest the placement of the following devices with justification if the company wants minimized network traffic : [1] 1)Repeater 2) Hub 3) Switch 4) Bridge iv) The company is planning to link its head office situated in India with the offices at Reliance. Suggest a way to connect it; the company does not want to compromise with the speed of connectivity. Justify your answer. [1]

Description
This content is useful for CBSE Students

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
62 Followers

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect