Gujarat Board Class 12 Computer Science Sample Papers 2011
Gujarat Board Sample Papers 2011 for Class 12 Computer Science
Class – XII
Computer Science
Instructions:
i) All questions are compulsory.
ii) Please write down the complete serial number of the question before attempting it.
1. a) Write the names of the header files to which the following belong : 2
(i) random( ) (ii) fmod( ) (iii)floodfill() (iv) gotoxy()
b) Name the header files to execute the following program: 2
void main ()
{
char name[20];
char ch;
strcpy(name, "I Revision 2009");
randomize();
clrscr();
ch = name[11+random(0)];
while (!isalpha(ch) )
{
if (isdigit (ch))
{
cout << setw(10) << int(ch);
}
ch = name[random(0)];
}
getch();
}
c) Rewrite the following program after removing syntactical error(s) if any. Underline each correction. 2
#include<iostream.h>
#define SIZE =10
VOID Main()
{
int a[SIZE]={1,2,3,4,5};
float x=2;
SIZE=5;
for(int i=0;i<SIZE;i++)
cout<<a[i]%x;
}
d) What are the first and last values of i output by this loop? 2
n = 10;
i = 0;
while (++i < n)
{ cout<<i<<endl; }
e) Differentiate between Local and Global variable with example. 2
2. a) Define a class ELECTION with the following specifications. Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details. 3
Private members:
Data : candidate_name, party, vote_received
Public members:
Functions : enterdetails ( ) – to input data
Display ( ) – to display the details of the winner
Winner ( ) – To return the details of the winner through the object after comparing the votes received by three candidates.
b) What do you mean by static data members of a class? Explain the characteristics of a static data member. 2
c) Find the Output of the following - 2
class alpha {
static int count;
public:
alpha() {
count++;
cout<<”n No. of object created”<<count; }
~alpha() {
cout<<”n No. of object destroyed”<<count;
count--; }
};
int alpha:: count=0;
void main() {
cout<<”n n ENTER MAIN n”;
alpha A1,A2,A3,A4;
{cout<<”nn ENTER BLOCK 1 n”;
alpha A5;}
{
cout<<”nn ENTER BLOCK 2 n”;
alpha A6;
}
cout<<”nn RE-ENTER MAIN n”;
}
d) Consider the following declarations and answer the questions given below: 3
class Mydata
{ protected:
int data;
public:
void Get_mydata(int);
void Manip_mydata(int);
void Show_mydata(int);
Mydata( );
~Mydata( ); };
class Personal_data
{
protected:
int data1;
public:
void Get_personaldata(int);
void Show_personaldata(int);
Mydata1( );
~Mydata1( ); };
class Person: public Mydata, Personal_data
{
public:
void Show_person(void);
person( );
~person( ); };
i) How many bytes will be required by an object belonging to class Person?
ii) Which type of inheritance is depicted in the above example?
iii) List the data members that can be accessed by the member function Show_person( )
iv) What is the order of constructor execution at the time of creating an object of class Person?
Computer Science
Instructions:
i) All questions are compulsory.
ii) Please write down the complete serial number of the question before attempting it.
1. a) Write the names of the header files to which the following belong : 2
(i) random( ) (ii) fmod( ) (iii)floodfill() (iv) gotoxy()
b) Name the header files to execute the following program: 2
void main ()
{
char name[20];
char ch;
strcpy(name, "I Revision 2009");
randomize();
clrscr();
ch = name[11+random(0)];
while (!isalpha(ch) )
{
if (isdigit (ch))
{
cout << setw(10) << int(ch);
}
ch = name[random(0)];
}
getch();
}
c) Rewrite the following program after removing syntactical error(s) if any. Underline each correction. 2
#include<iostream.h>
#define SIZE =10
VOID Main()
{
int a[SIZE]={1,2,3,4,5};
float x=2;
SIZE=5;
for(int i=0;i<SIZE;i++)
cout<<a[i]%x;
}
d) What are the first and last values of i output by this loop? 2
n = 10;
i = 0;
while (++i < n)
{ cout<<i<<endl; }
e) Differentiate between Local and Global variable with example. 2
2. a) Define a class ELECTION with the following specifications. Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details. 3
Private members:
Data : candidate_name, party, vote_received
Public members:
Functions : enterdetails ( ) – to input data
Display ( ) – to display the details of the winner
Winner ( ) – To return the details of the winner through the object after comparing the votes received by three candidates.
b) What do you mean by static data members of a class? Explain the characteristics of a static data member. 2
c) Find the Output of the following - 2
class alpha {
static int count;
public:
alpha() {
count++;
cout<<”n No. of object created”<<count; }
~alpha() {
cout<<”n No. of object destroyed”<<count;
count--; }
};
int alpha:: count=0;
void main() {
cout<<”n n ENTER MAIN n”;
alpha A1,A2,A3,A4;
{cout<<”nn ENTER BLOCK 1 n”;
alpha A5;}
{
cout<<”nn ENTER BLOCK 2 n”;
alpha A6;
}
cout<<”nn RE-ENTER MAIN n”;
}
d) Consider the following declarations and answer the questions given below: 3
class Mydata
{ protected:
int data;
public:
void Get_mydata(int);
void Manip_mydata(int);
void Show_mydata(int);
Mydata( );
~Mydata( ); };
class Personal_data
{
protected:
int data1;
public:
void Get_personaldata(int);
void Show_personaldata(int);
Mydata1( );
~Mydata1( ); };
class Person: public Mydata, Personal_data
{
public:
void Show_person(void);
person( );
~person( ); };
i) How many bytes will be required by an object belonging to class Person?
ii) Which type of inheritance is depicted in the above example?
iii) List the data members that can be accessed by the member function Show_person( )
iv) What is the order of constructor execution at the time of creating an object of class Person?
Gujarat Board Best Sellers
In order to keep pace with technological advancement and to cope up with Gujarat Board examinations, Pearson group has launched Edurite to help students by offering Books and CDs of different courses online.
Sign Up FREE
Get help on Gujarat Board Sample Question Paper for class 12 Now
Board Sample Paper
- CBSE Board Class 11 English Elective 2007
- Madhya Pradesh Board Class 12 Book keeping & Accountancy 2013-2
- Madhya Pradesh Board Class 12 Political Science 2013
- CBSE Board Class 12 Fashion Studies 2007
- Madhya Pradesh Board Class 12 Math 2013-SET-2
- CBSE Board Class 12 Computer Science 2009
- Tamilnadu Board Class 10 English Core Sample Papers 2012
- West Bengal Board Class 11 Economics Sample Paper OF 2012
- Madhya Pradesh Board Class 12 Home Management, Nutrition & Textile 2013-SET-3
- ICSE Board Class 10 Biology 2010
Previous Year Paper
- CBSE Board Class 11 Political Science 2005
- CBSE Board Class 11 Economics 2009
- CBSE Board Class 11 History 2008
- CBSE Board Class 11 English Elective 2007
- CBSE Board Class 10 English Elective 2007
- CBSE Board Class 10 Social Science 2010
- CBSE Board Class 12 Chemistry 2008
- CBSE Board Class 12 History 2011
- CBSE Board Class 12 Psychology 2010
- Gujarat Board Class 12 Chemistry Previous Year Question paper of 2007
Syllabus
- Haryana Board Class 12 Punjabi
- Madhya Pradesh Board Class 10 Marathi (special)
- Rajasthan Board Class 10 Social Science
- Manipur Board Class 9 Bengali
- Haryana Board Class 12 Fine Arts
- Manipur Board Class 9 Hindi
- Haryana Board Class 12 Economics
- Madhya Pradesh Board Class 11 National, Social Service(NSS)
- Maharashtra Board Class 11 Physics syllabus
- ICSE Board Class 10 Computer Science


