CBSE Board Class 12 Computer Science Sample Papers 2010
CBSE Board Sample Papers 2010 for Class 12 Computer Science
COMPUTER SCIENCE (Theory) - Class XII
Sample Question Paper–2010
TIME : 3 Hrs
MM : 70
No.
Questions
Marks
1.
(a) What is the difference between Global Variable and Local Variable? Also, give
a suitable C++ code to illustrate both.
2
(b) Which C++ header file(s) will be essentially required to be included to run /
execute the following C++ code:
1
void main()
{
char Msg[ ]="Sunset Gardens";
for (int I=5;I<strlen(Msg);I++)
puts(Msg);
}
(c)
Rewrite the following program after removing the syntactical errors (if any).
Underline each correction.
#include [iostream.h]
class MEMBER
{
int Mno;float Fees;
PUBLIC:
void Register(){cin>>Mno>>Fees;}
void Display{cout<<Mno<<" : "<<Fees<<endl;}
};
void main()
{
MEMBER M;
Register();
M.Display();
}
4
2
No.
(d)
Questions
Find the output of the following program:
Marks
3
#include <iostream.h>
struct GAME
{ int Score, Bonus;};
void Play(GAME &g, int N=10)
{
g.Score++;g.Bonus+=N;
}
void main()
{
GAME G={110,50};
Play(G,10);
cout<<G.Score<<":"<<G.Bonus<<endl;
Play(G);
cout<<G.Score<<":"<<G.Bonus<<endl;
Play(G,15);
cout<<G.Score<<":"<<G.Bonus<<endl;
}
(e)
Find the output of the following program:
#include <iostream.h>
void Secret(char Str[ ])
{
for (int L=0;Str[L]!='\0';L++);
for (int C=0;C<L/2;C++)
if (Str[C]=='A' || Str[C]=='E')
Str[C]='#';
else
{
char Temp=Str[C];
5
2
No.
Questions
Marks
Str[C]=Str[L-C-1];
Str[L-C-1]=Temp;
}
}
void main()
{
char Message[ ]="ArabSagar";
Secret(Message);
cout<<Message<<endl;
}
(f)
In the following program, if the value of Guess entered by the user is 65, what
will be the expected output(s) from the following options (i), (ii), (iii) and (iv)?
2
#include <iostream.h>
#include <stdlib.h>
void main()
{
int Guess;
randomize();
cin>>Guess;
for (int I=1;I<=4;I++)
{
New=Guess+random(I);
cout<<(char)New;
}
}
(i) ABBC
(ii) ACBA
(iii) BCDA
(iv) CABD
6
No.
Questions Marks
What do you understand by Data Encapsulation and Data Hiding? Also, give 2
a suitable C++ code to illustrate both.
Answer the questions (i) and (ii) after going through the following class: 2
2.
(a)
(b)
class Seminar
{
int Time;
public:
Seminar()
//Function 1
{
Time=30;cout<<"Seminar starts now"<<end1;
}
void Lecture()
//Function 2
{
cout<<"Lectures in the seminar on"<<end1;
}
Seminar(int Duration)
//Function 3
{
Time=Duration;cout<<"Seminar starts now"<<end1;
}
~Seminar()
//Function 4
{
cout<<"Vote of thanks"<<end1;
}
};
i) In Object Oriented Programming, what is Function 4 referred as and when does it get
invoked/called?
ii) In Object Oriented Programming, which concept is illustrated by Function 1 and
Function 3 together? Write an example illustrating the calls for these functions.
7
No.
(c)
Questions
Define a class TEST in C++ with following description:
Marks
4
Private Members
• TestCode of type integer
• Description of type string
• NoCandidate of type integer
• CenterReqd (number of centers required) of type integer
• A member function CALCNTR() to calculate and return the number of centers as
(NoCandidates/100+1)
Public Members
• •
(d)
A function SCHEDULE() to allow user to enter values for TestCode,
Description, NoCandidate & call function CALCNTR() to calculate the number of
Centres
A function DISPTEST() to allow user to view the content of all the data members
Answer the questions (i) to (iv) based on the following:
class PUBLISHER
{
char Pub[12];
double Turnover;
protected:
void Register();
public:
PUBLISHER();
void Enter();
void Display();
};
class BRANCH
{
char CITY[20];
protected:
float Employees;
8
4
No.
Questions
Marks
public:
BRANCH();
void Haveit();
void Giveit();
};
class AUTHOR : private BRANCH , public PUBLISHER
{
int Acode;
char Aname[20];
float Amount;
public:
AUTHOR();
void Start();
void Show();
};
(i) (ii) Write the names of all the member functions which are accessible from ob- (iii) Write the names of all the members which are accessible from member func- (iv)
jects belonging to class BRANCH. tions of class AUTHOR.
3.
Write the names of data members, which are accessible from objects belong- How many bytes will be required by an object belonging to class AUTHOR? (a) Write a function in C++ to merge the contents of two sorted arrays A & B into 3
ing to class AUTHOR. third array C. Assuming array A and B are sorted in ascending order and the
resultant array C is also required to be in ascending order.
(b) An array S[40][30] is stored in the memory along the row with each of the ele- 3
ment occupying 2 bytes, find out the memory location for the element S[20][10],
if the Base Address of the array is 5000.
(c) Write a function in C++ to perform Insert operation in a dynamically 4
allocated Queue containing names of students.
(d) Write a function in C++ to find the sum of both left and right diagonal ele- 2
9
No.
Questions
Marks
ments from a two dimensional array (matrix).
(e)
Evaluate the following postfix notation of expression:
2
20, 30, +, 50, 40, - ,*
4.
(a)
Observe the program segment given below carefully and fill the blanks
marked as Statement 1 and Statement 2 using seekp() and seekg() functions
for performing the required task.
#include <fstream.h>
class Item
{
int Ino;char Item[20];
public:
//Function to search and display the content from a particular record number
void Search(int );
//Function to modify the content of a particular record number
void Modify(int);
};
void Item::Search(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary|ios::in);
______________________
//Statement 1
File.read((char*)this,sizeof(Item));
cout<<Ino<<"==>"<<Item<<endl;
File.close();
}
void Item::Modify(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary|ios::in|ios::out);
10
1
No.
Questions
Marks
cout>>Ino;cin.getline(Item,20);
______________________
//Statement 2
File.write((char*)this,sizeof(Item));
File.close();
}
(b)
(c)
Write a function in C++ to count the number of lines present in a text file
"STORY.TXT".
2
Write a function in C++ to search for a BookNo from a binary file "BOOK.DAT",
assuming the binary file is containing the objects of the following class.
3
class
{
int Bno;
char Title[20];
public:
int RBno(){return Bno;}
void Enter(){cin>>Bno;gets(Title);}
void Display(){cout<<Bno<<Title<<endl;}
};
5.
(a)
What do you understand by Degree and Cardinality of a table?
2
Consider the following tables ACTIVITY and COACH and answer
(b) and (c) parts of this question:
Table: ACTIVITY
A Code ActivityName
Stadium
Participants Prize
Num
Money
1001 Relay 100x4 Star Annex 16 10000 23-Jan-2004
1002 High jump Star Annex 10 12000 12-Dec-2003
1003 Shot Put Super Power 12 8000 14-Feb-2004
1005 Long Jump Star Annex 12 9000 01-Jan-2004
1008 Discuss Throw Super Power 10 15000 19-Mar-2004
11
Schedule
Date
No.
Questions
Marks
Table: COACH
PCode
Acode
1 Ahmad Hussain 1001
2 Ravinder 1008
3 Janila 1001
4
(b)
Name Naaz 1003
Write SQL commands for the flowing statements:
(i) To display sum of PrizeMoney for the Activities played in each of the Stadium
separately.
(iii) To display the coach's name and ACodes in ascending order of ACode from
the table COACH
(iv)
(c)
To display the names of all activities with their Acodes in descending order.
(ii)
4
To display the content of the Activity table whose ScheduleDate earlier than
01/01/2004 in ascending order of ParticipantsNum.
Give the output of the following SQL queries:
(i) SELECT COUNT(DISTINCT ParticipantsNum) FROM ACTIVITY;
(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM ACTIVITY;
(iii)
2
SELECT Name,ActivityName FROM ACTIVITY A,COACH C
WHERE A.Acode=C.Acode AND A.ParticipantsNum=10;
(iv)
SELECT DISTINCT Acode FROM COACH;
6.
(a) State and verify Demorgan's Laws algebraically. 2
(b) Write the equivalent Boolean Expression for the following Logic Circuit 2
12
No. Questions Marks
(c) Write the POS form of a Boolean function F, which is represented in a truth table as 1
follows:
U W F
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1
(d)
V 1 1 1
Reduce the following Boolean Expression using K-Map:
3
F(A,B,C,D)= (0,1,2,4,5,6,8,10)
7.
a) Compare any two Switching techniques. 1
b) Which of the following is not a Client Side script: 1
(i) VB Script (ii) Java Script
(iii) ASP (iv) PHP
c) If someone has hacked your Website, to whom you lodge the Complain?
1
d) What do you mean by IP Address? How is it useful in Computer Security?
1
e) Knowledge Supplement Organisation 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:
4
13
No.
Questions
Marks
Center to center distances between various blocks
Black A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 m
Block A to Block C 90 m
Number of Computers
Black A 25
Block B 50
Block C 125
Block D 10
e1) Suggest a cable layout of connections between the blocks.
e2) Suggest the most suitable place (i.e. block) to house the server of this organisation
with a suitable reason.
e3) Suggest the placement of the following devices with justification
(i) Repeater
(ii) Hub/Switch
e4) The organization is planning to link its front office situated in the city in a hilly region f) What do you mean by Spam Mails? How can you protect your mailbox from Spams? 1
where cable connection is not feasible, suggest an economic way to connect it with
reasonably high speed?
g) Mention any two advantages of Open Source Software over Proprietary Software. 1
Sample Question Paper–2010
TIME : 3 Hrs
MM : 70
No.
Questions
Marks
1.
(a) What is the difference between Global Variable and Local Variable? Also, give
a suitable C++ code to illustrate both.
2
(b) Which C++ header file(s) will be essentially required to be included to run /
execute the following C++ code:
1
void main()
{
char Msg[ ]="Sunset Gardens";
for (int I=5;I<strlen(Msg);I++)
puts(Msg);
}
(c)
Rewrite the following program after removing the syntactical errors (if any).
Underline each correction.
#include [iostream.h]
class MEMBER
{
int Mno;float Fees;
PUBLIC:
void Register(){cin>>Mno>>Fees;}
void Display{cout<<Mno<<" : "<<Fees<<endl;}
};
void main()
{
MEMBER M;
Register();
M.Display();
}
4
2
No.
(d)
Questions
Find the output of the following program:
Marks
3
#include <iostream.h>
struct GAME
{ int Score, Bonus;};
void Play(GAME &g, int N=10)
{
g.Score++;g.Bonus+=N;
}
void main()
{
GAME G={110,50};
Play(G,10);
cout<<G.Score<<":"<<G.Bonus<<endl;
Play(G);
cout<<G.Score<<":"<<G.Bonus<<endl;
Play(G,15);
cout<<G.Score<<":"<<G.Bonus<<endl;
}
(e)
Find the output of the following program:
#include <iostream.h>
void Secret(char Str[ ])
{
for (int L=0;Str[L]!='\0';L++);
for (int C=0;C<L/2;C++)
if (Str[C]=='A' || Str[C]=='E')
Str[C]='#';
else
{
char Temp=Str[C];
5
2
No.
Questions
Marks
Str[C]=Str[L-C-1];
Str[L-C-1]=Temp;
}
}
void main()
{
char Message[ ]="ArabSagar";
Secret(Message);
cout<<Message<<endl;
}
(f)
In the following program, if the value of Guess entered by the user is 65, what
will be the expected output(s) from the following options (i), (ii), (iii) and (iv)?
2
#include <iostream.h>
#include <stdlib.h>
void main()
{
int Guess;
randomize();
cin>>Guess;
for (int I=1;I<=4;I++)
{
New=Guess+random(I);
cout<<(char)New;
}
}
(i) ABBC
(ii) ACBA
(iii) BCDA
(iv) CABD
6
No.
Questions Marks
What do you understand by Data Encapsulation and Data Hiding? Also, give 2
a suitable C++ code to illustrate both.
Answer the questions (i) and (ii) after going through the following class: 2
2.
(a)
(b)
class Seminar
{
int Time;
public:
Seminar()
//Function 1
{
Time=30;cout<<"Seminar starts now"<<end1;
}
void Lecture()
//Function 2
{
cout<<"Lectures in the seminar on"<<end1;
}
Seminar(int Duration)
//Function 3
{
Time=Duration;cout<<"Seminar starts now"<<end1;
}
~Seminar()
//Function 4
{
cout<<"Vote of thanks"<<end1;
}
};
i) In Object Oriented Programming, what is Function 4 referred as and when does it get
invoked/called?
ii) In Object Oriented Programming, which concept is illustrated by Function 1 and
Function 3 together? Write an example illustrating the calls for these functions.
7
No.
(c)
Questions
Define a class TEST in C++ with following description:
Marks
4
Private Members
• TestCode of type integer
• Description of type string
• NoCandidate of type integer
• CenterReqd (number of centers required) of type integer
• A member function CALCNTR() to calculate and return the number of centers as
(NoCandidates/100+1)
Public Members
• •
(d)
A function SCHEDULE() to allow user to enter values for TestCode,
Description, NoCandidate & call function CALCNTR() to calculate the number of
Centres
A function DISPTEST() to allow user to view the content of all the data members
Answer the questions (i) to (iv) based on the following:
class PUBLISHER
{
char Pub[12];
double Turnover;
protected:
void Register();
public:
PUBLISHER();
void Enter();
void Display();
};
class BRANCH
{
char CITY[20];
protected:
float Employees;
8
4
No.
Questions
Marks
public:
BRANCH();
void Haveit();
void Giveit();
};
class AUTHOR : private BRANCH , public PUBLISHER
{
int Acode;
char Aname[20];
float Amount;
public:
AUTHOR();
void Start();
void Show();
};
(i) (ii) Write the names of all the member functions which are accessible from ob- (iii) Write the names of all the members which are accessible from member func- (iv)
jects belonging to class BRANCH. tions of class AUTHOR.
3.
Write the names of data members, which are accessible from objects belong- How many bytes will be required by an object belonging to class AUTHOR? (a) Write a function in C++ to merge the contents of two sorted arrays A & B into 3
ing to class AUTHOR. third array C. Assuming array A and B are sorted in ascending order and the
resultant array C is also required to be in ascending order.
(b) An array S[40][30] is stored in the memory along the row with each of the ele- 3
ment occupying 2 bytes, find out the memory location for the element S[20][10],
if the Base Address of the array is 5000.
(c) Write a function in C++ to perform Insert operation in a dynamically 4
allocated Queue containing names of students.
(d) Write a function in C++ to find the sum of both left and right diagonal ele- 2
9
No.
Questions
Marks
ments from a two dimensional array (matrix).
(e)
Evaluate the following postfix notation of expression:
2
20, 30, +, 50, 40, - ,*
4.
(a)
Observe the program segment given below carefully and fill the blanks
marked as Statement 1 and Statement 2 using seekp() and seekg() functions
for performing the required task.
#include <fstream.h>
class Item
{
int Ino;char Item[20];
public:
//Function to search and display the content from a particular record number
void Search(int );
//Function to modify the content of a particular record number
void Modify(int);
};
void Item::Search(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary|ios::in);
______________________
//Statement 1
File.read((char*)this,sizeof(Item));
cout<<Ino<<"==>"<<Item<<endl;
File.close();
}
void Item::Modify(int RecNo)
{
fstream File;
File.open("STOCK.DAT",ios::binary|ios::in|ios::out);
10
1
No.
Questions
Marks
cout>>Ino;cin.getline(Item,20);
______________________
//Statement 2
File.write((char*)this,sizeof(Item));
File.close();
}
(b)
(c)
Write a function in C++ to count the number of lines present in a text file
"STORY.TXT".
2
Write a function in C++ to search for a BookNo from a binary file "BOOK.DAT",
assuming the binary file is containing the objects of the following class.
3
class
{
int Bno;
char Title[20];
public:
int RBno(){return Bno;}
void Enter(){cin>>Bno;gets(Title);}
void Display(){cout<<Bno<<Title<<endl;}
};
5.
(a)
What do you understand by Degree and Cardinality of a table?
2
Consider the following tables ACTIVITY and COACH and answer
(b) and (c) parts of this question:
Table: ACTIVITY
A Code ActivityName
Stadium
Participants Prize
Num
Money
1001 Relay 100x4 Star Annex 16 10000 23-Jan-2004
1002 High jump Star Annex 10 12000 12-Dec-2003
1003 Shot Put Super Power 12 8000 14-Feb-2004
1005 Long Jump Star Annex 12 9000 01-Jan-2004
1008 Discuss Throw Super Power 10 15000 19-Mar-2004
11
Schedule
Date
No.
Questions
Marks
Table: COACH
PCode
Acode
1 Ahmad Hussain 1001
2 Ravinder 1008
3 Janila 1001
4
(b)
Name Naaz 1003
Write SQL commands for the flowing statements:
(i) To display sum of PrizeMoney for the Activities played in each of the Stadium
separately.
(iii) To display the coach's name and ACodes in ascending order of ACode from
the table COACH
(iv)
(c)
To display the names of all activities with their Acodes in descending order.
(ii)
4
To display the content of the Activity table whose ScheduleDate earlier than
01/01/2004 in ascending order of ParticipantsNum.
Give the output of the following SQL queries:
(i) SELECT COUNT(DISTINCT ParticipantsNum) FROM ACTIVITY;
(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM ACTIVITY;
(iii)
2
SELECT Name,ActivityName FROM ACTIVITY A,COACH C
WHERE A.Acode=C.Acode AND A.ParticipantsNum=10;
(iv)
SELECT DISTINCT Acode FROM COACH;
6.
(a) State and verify Demorgan's Laws algebraically. 2
(b) Write the equivalent Boolean Expression for the following Logic Circuit 2
12
No. Questions Marks
(c) Write the POS form of a Boolean function F, which is represented in a truth table as 1
follows:
U W F
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1
(d)
V 1 1 1
Reduce the following Boolean Expression using K-Map:
3
F(A,B,C,D)= (0,1,2,4,5,6,8,10)
7.
a) Compare any two Switching techniques. 1
b) Which of the following is not a Client Side script: 1
(i) VB Script (ii) Java Script
(iii) ASP (iv) PHP
c) If someone has hacked your Website, to whom you lodge the Complain?
1
d) What do you mean by IP Address? How is it useful in Computer Security?
1
e) Knowledge Supplement Organisation 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:
4
13
No.
Questions
Marks
Center to center distances between various blocks
Black A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 m
Block A to Block C 90 m
Number of Computers
Black A 25
Block B 50
Block C 125
Block D 10
e1) Suggest a cable layout of connections between the blocks.
e2) Suggest the most suitable place (i.e. block) to house the server of this organisation
with a suitable reason.
e3) Suggest the placement of the following devices with justification
(i) Repeater
(ii) Hub/Switch
e4) The organization is planning to link its front office situated in the city in a hilly region f) What do you mean by Spam Mails? How can you protect your mailbox from Spams? 1
where cable connection is not feasible, suggest an economic way to connect it with
reasonably high speed?
g) Mention any two advantages of Open Source Software over Proprietary Software. 1
CBSE Board Best Sellers
In order to keep pace with technological advancement and to cope up with CBSE 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 CBSE Board Sample Question Paper for class 12 Now
Board Sample Paper
- Gujarat Board Class 10 Social Science 2011
- CBSE Board Class 12 English Core 2008
- CBSE Board Class 11 Chemistry 2010
- CBSE Board Class 11 History 2009
- West Bengal Board Class 11 Economics Sample Paper OF 2012
- Madhya Pradesh Board Class 12 Informatics Practices 2013
- CBSE Board Class 12 Political Science 2010
- Gujarat Board Class 12 Chemistry 2011
- ICSE Board Class 10 Biology 2007
- CBSE Board Class 11 Functional English 2005
Previous Year Paper
- CBSE Board Class 12 Fashion Studies 2011
- CBSE Board Class 10 English Elective 2005
- CBSE Board Class 11 English Core 2009
- CBSE Board Class 12 Psychology 2011
- CBSE Board Class 12 Biology 2009
- CBSE Board Class 11 History 2008
- Gujarat Board Class 12 Chemistry Previous Year Question paper of 2007
- CBSE Board Class 11 Business Studies 2009
- CBSE Board Class 11 Physics 2007
- CBSE Board Class 11 Biology 2008
Syllabus
- Madhya Pradesh Board Class 12 Gujarati (special)
- Madhya Pradesh Board Class 9 Telugu(Special)
- Gujarat Board Class 12 Political Science
- CBSE Board Class 11 Math
- Bihar Board Class 11Computer Science
- Madhya Pradesh Board Class 10 Sindhi
- Madhya Pradesh Board Class 12 History
- Madhya Pradesh Board Class 12 Element of Science
- CBSE Board 12th Geography Syllabus
- Maharashtra Board Class 12 Math & statistics syllabus



