(Download) CBSE Class XII Computer Science Guess Paper 2012 (Set-I)

Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in

https://cbseportal.com/sites/default/files/CBSE-LOGO.jpg

CBSE - NEW DELHI

Guess Paper – 2012

Class – XII

 Subject – Computer Science

M.M.70                                                                                                                                                                                                       
 TIME: 3 HRS

GENERAL INSTRUCTIONS:

  • Paper consists of 8 printed pages
  • All questions are compulsory
  • Programming language: C++

Question
1.

a) What is the difference between entry controlled loop and exit
controlled loop? Illustrate your answer
with a C++ valid code. 2

b) Name the header files(s)
used for successive compilation of the following: 1

void main( )

{

char
word[30];

strcpy
( word, “Pre Board Examination “);

int s =
strlen (word);

if(s%2= = 0)

cout<<setw(20)<<word;

}

c) Rewrite the following
code after removing syntactical error(s), if any.

Underline each
correction:
2

#include<iostream.h>

class Exams

{ char
E_name[30], S_name[30];

int S_nos =
100;

float
marks[3];

public:

Exams ( ) {
};

void
input( )

{ strcpy(E_name, “Computer Science “);

strcpy(S_name, “Amen
Singhania “);

cin>>marks;

}

void
output( )

{

cout<<”Name “<<S_name<<endl;

cout<<”S_Name”<<E_name<<endl;

cout<<”Number
“<<S_nos<<endl;

}

};

void main( )

{ Exams
E;

E.input; E.display;
}

d) Write the output of the
following
code: 2

# include<iostream.h>

# include<ctype.h>

void manipulate( char
string[], int & len)

{

for(
int i=0; string[i]!=’\0’;i++)

{

if (isupper(string[i]))

string[i]= string[i]-2;
len++;

else

if (isupper(string[i]))

string[i]=string[i+2];
−−len;

else

string[i]=’@’;

}
}

void main( )

{ char
word[]= “FuN UnliMiTEd!! “;

int
length=strlen(word);

manipulate (word, length );

cout<<”Word
“<<word<<”@”<<”Length”<<length;

}

e) Find the output 3

#include<iostream.h>

void in( int x, int y, int
&z)

{ x+=y;

y--;

z*=(x-y);

}

void out( int z, int y, int
&x)

{ x−= y;

y++;

z/=(x+y);

}

void main( )

{

int a= 20, b=30,
c=10;

in (a, c, b);

cout<<a<<”#”<<b<<”#”<<c<<”#”<<endl;

out (b, c, a);

cout<<a<<”@”<<b<<”@”<<c<<”@”<<endl;

in (a, b, c);

cout<<a<<”$”<<b<<”$”<<c<<”$”<<endl;

}

f) Chose the correct alternative
from the options (i)- (iv). Justify your answer. 2

#include<iostream.h>

#include<stdlib.h>

#define Getval (N)
((N%2 = =0)? N+1:N+2)

void main( )

{
randomize( );

int num=
random(3)+3;

for( int I=
num ; I<=num+2 ;I++)

cout<<Getval(I)<<’@’;

}

Options: a) 3@5@7@

b) 7@7@9@

c) 7@9@9@

d) 7@9@11@

Question 2

a) Give
differences between a copy and a parameterized constructor. Also
use a suitable C++ code to support your
answer. 2

b)
Answer questions 1 and 2 after going through the following
class: 2

class game

{ char name[20]; int players;

public:

game (int,
char*); // MODULE 1

game
(game&); // MODULE 2

~game(
); // MODULE
3

};

1. Define MODULE 2 outside the class.

2. What is MODULE 3 known as? Which OOP concept do they imply?

c) Define a class STUDENT in C++ with the following specifications
: 4

Class
name Data
Members Type

Student
Std_name string

Std_rollno long

Marks float

Stream string

· A function Assign_stream( ) to assign stream on the following basis:

Marks Stream

300 and
above Science

Between 250 and
300 Commerce

Between 200 and
250 Humanities

Below
200 NULL

Public
Member Functions:

· A constructor to initialize data members with legal initial values.

· A function Initialize ( ) to input the values for the data members and
invoke the Assign_stream ( ) function.

· A function to display the values of data members.

d) Answer Questions 1 to 4 after going through the following
code: 4

class drama
{ char dname[20];

int Dduration;

protected:

char
dactors[10][20];

public:

void enterdrama(
);

void displaydrama(
); };

class realityshow { char
rname[15];

int
Rduration;

protected:

char Rparticipants[15][20];

public:

void enterreality ( );

void dispreality( ); };

class news{
int Nduration;

char nreader[10][15];

public:

void enternews( );

void dispnews(
) };

class tvprog : public drama,
private realityshow, public news

{
char chnlgrp[20];

float pkgcost;

public:

void enterprog( );

void dispprog(
); };

  • Write the names of all members accessible from dispprog( ) of class
    tvprog.
  • Write name of all data members accessible from object of class tvprog.
  • Calculate size of an object of class tvprog.
  • Write the order for the call of the constructors when object of class tvprog is declared.