Guess Papers Computer Science

  CBSE You are here

Download CBSE Guess Paper Class Computer Science XII (12th) 2009

Guess Paper – 2009

Class – XII

Subject – Computer Science

(SET-1)

(C++ Revision tour, Classes and Objects, Constructor)

Time :3Hrs                                               Max Marks:70 1.    a)   Name the header files to which the following belong:      (2)              i) isalnum ( )    ii) strcat( )    iii) random ( )       iv) setw( )

b)    In the following C++ program what is expected value of myscore from options                (i) to (iv) given below.            (2)

#include<stdlib.h>

#include<iostream.h>

void main(  )

{

randomize( );int score[]={ 25, 20,34,56, 72, 63};int myscore=score[2+random(2)];cout<<myscore<<endl; }

i) 25        ii) 34        iii) 20        iv) None of these

c)    Predict the output:                    (2)            for( int i=1;i<4;i++)                {                cout<< “

”;

for( int j=1; j<=I;j++)

cout<< “*”;

}

d) Rewrite the following program after removing the syntactical error , if any.  Under line each correction.                (2)            #include<iostream.h>

const int Devidor 5;

void amin( )

{

Number=15;

for(int count=1;count<=5;count++)                    if( Number/ Devidor= = 0)

cout<<Number/Devidor;                        cout<<endl;

Else

cout<< Number+Devidor<<endl;

e) Find the output of the following program:        (2)            #include<string.h>

#include<iostream.h>

#include<ctype.h>

void change(char msg[ ], int len)                    {

for( int count=0;count< len;count++)                        {

if(islower(msg[ count]))

msg[count]=toupper(msg[count]);                                                            else

if(isupper(msg[ count]))

msg[count]=tolower(msg[count]);                                                            else if(isdigit(msg[ count]))

msg[count]=msg[count]+1;

else

msg[count]= ‘*’;

}                                                             }

void main(  )

{

char message[ ]= “ 15th  AugusT CelebratED”;                                                       int size= strlen( message);

change(message,size);

cout<<message<<endl;

for( int c=0;,r=size-1;c<=size/2; c++,r--)                                                          {

char temp=message[c];                                                                    message[c]=message[r];

message[r]=temp;

}

cout<<message<<endl;

}

f) What is the difference between call by value and call by reference?       Give   example?                    (2)

2.a)   What is inline function? Write two advantages of using inline functions?        (2)

b)    Define copy constructor? Mention the condition where a copy constructor is invoked?                    (2)

c)   Encapsulation is one of the major properties of OOP? How is it implemented  in C++?                     (2)

d)  What is the difference between global and local variables ? Give an example to illustrate the same?                             (2)    e)  Write the output of the following code:                (3)                #include<iostream.h>

int func( int &x,int y=10)

{

if(x%y==0) return ++X; else return y- -;                        }

void main( )

{

int p=20, q=23;

q= func(p,q);

cout<<p<<q<<endl;

p= func(q);

cout<<p<<q<<endl;

q= func(p);

cout<<p<<q<<endl;

}

f) Predict the output:                        (1)            for(int i=0; i<=10;i++);

cout<<I;

Download this full post



  « Guess Papers Accountancy MP Board English (General) Class – X 2006 (Set 3) »  

  Posted on Monday, December 29th, 2008 at 6:08 PM under   CBSE | RSS 2.0 Feed