Вы находитесь на странице: 1из 15

Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?

ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

MODEL PAPER
Class XII (COMPUTER SCIENCE)
Sample Question Paper –1

Time Duration 3 Hrs Max. Marks 70

Note
1. All question ae Compulsory
2. Programming Language C++
1 Answer the following
A Name the header file of c++ which following function belongs 2
i) clrscr() ii gets() iii toupper() iv isdigit()
B What is the difference between local and global variables ? Give the Examples
of boths 2
C Rewrite the following program after removing all syntax errors if any 2
#include(iostream.h)
Void main();
{
int X[]=60,50,30,40},Y=0;count=4;
cin>>Y;
for(i=count-1;i>=0,i--)
switch(i)
{
case 0 :
case 2: cout<<Y*X[i]<<endl;
break;
case 1 :
case 3 : cout>> Y+X[i];
}
}
D Write the output of the following program 2
void main()
{
int x=5;int y=5;
cout<<x--;
cout<<”,”;
cout<< --x;
cout<<”,”;
cout<<y--<<”,”<< --y;
}
E. Explain Nested Structure with Example 2
F. Will the syntax error if any (Give the reason for error) 2
Class ABC
{
int x=10;

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

float y;
abc()
{ y=5;}
~( )
{}
void main()
{
ABC a1,a2;
}

2 Answer the following


A Explain Protected, Private and public members of a class in context of inhertence 2
B Answer the following question i and ii after going through the following class 2
class Exam
{
int marks;
char subject[20];
public :
Exam() //Function 1
{ marks=0;strcpy(subject,”Computer”);}
Exam(char s[]) //Function 2
{ marks=0;strcpy(subject,s);}
Exam(int m) //Function 3
{ marks=m;strcpy(subject,”Computer”);}
Exam(int m, char s[]) //Function 4
{ marks=m;strcpy(subject,s);}
}
i Write a statement in C++ that would execute functions 3 and function 4 of class Exam
ii Which features ogf object oriented programming is demonstrated using function 1 function 2
function 3 and function 4 in the above class.
C Define a class travel in c++ with the following descriptions 4
Private members
Travel code of type long
Place of type character array
No_of_travellers of type integer
No_of_buses of type integer

Public members
Aconstructor to assign initial values of travel code as 201, place as “Nanital” ,no_of_travellers as
10 no_of buses as 1A function newtravel() which allow user to enter travel code place and no_of
travelers also assign a value of no_of_buses as per the following condition

No of traveler no of buses

Less than 20 1
Equal to 20 or less than 40 2
Equal to 40 o more than 40 3
A function show_travel() to display the content from all the data members on screen.

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

D. Explain polymorphism with suitable example? 4

3 Answer the following


A Write a Function in C++ to print the sum of all four corners of a two
dimensional array.
[Assuming the 2D Array to be a square matrix with odd dimension 3
i.e. 3×3, 5×5, 7×7 etc...]
Example, if the array content is
3 5 4
7 6 9
2 1 8
Output through the function should be :
The sum of corner is 3+4+2+8= 17
B An Array MAT[30][10] is to stored in memory column wise with each elements occupying 8
bytes of memory. Find out the base address and the address of element MAT[20][5], if the
location of MAT[5][7] is stored at address 1000. 4
C Write a Function in UPPER HALF() which takes a two dimensional array A with size N rows
and N columns as argument and point the upper half of the array. 2
ThaArray is
3 4 2 5 5
2 1 2 3 4
2 1 2 3 3
4 2 1 2 1
1 2 4 7 1

The output is
3 4 2 5 5
1 2 3 4
2 3 3
2 1
1
D Write a function to perform a PUSH Operation on a dynamically allocated stack containg real
number? 3
E Evaute the expression 562+*124/- in tabular form showing stack after every step 2

4 Answer the following


A Assuming that a text file named First.TXT contains some text written into it, write a function
named vowelwords(), that reads the first.txt and create a new file named second.txt to contain
only those words from the file First.txt which start with a lowercase vowel(i.e. ‘a’,’e’,’I’,’o’,’u’) For
example 3
Carry umbrella and overcoat when it rains
Then the file second.txt contains
Umbrella and overcoat it
B Write a function to open a files in read and write mode 1
C Write a c++ function copies all the lowercase letters in text file called “mytext.txt” into file called
“lower.txt” 2

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

5 Answer the following


A What do you understand by Degree and Cardinality of a table? 2
B Given the following table for a database library
Table BOOKS

Book_id Book_name Author_name Publishers Price Type Qty


C0001 Fast cook Lata kapoor EPB 365 Cookery 5
F0001 The Tears William First Pub 650 Fiction 20
Hopkins
T0001 My First Brain EPB 350 Text 10
C++ &Brooke
T0002 C++ A.W.Rossaine TDH 350 Text 15
Brainworks
F0002 Thunderbolts Anna Roberts First Pub 750 Fiction 50

Table ISSUED

Book_ID Quantity_Issued
T0001 4
C0001 5
F0001 2

Write Sql Queries from i to vi


i. to show book name,author name and price of books of first pub publisher 1
ii to list the names from books of text type. 1
iii to display the names and price from books in asending order of their prices 1
iv to increase the price of all books of EPB publisher by 50
v to display book_id,book_name and quantity_issued for all books which have been
issued(the query will require contents from both tables)
vi to insert new row in the table issued having the following data “F0003, 1 1

vii Give the output of the following


a) Select count(*) from books;
b) Selectmax(price) from books where quantity >=15;
c) Select count(distinct publishers) from books;

Q 6 Answer the following


A Prove the Demorgan Theorem ? 2
B Reduce the following Boolean Expression from K Map

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

F(A,B,C,D)=?×(0,1,2,4,5,6,8,10) 3
C Draw a logic Circuit for Half Adder 2
D write the POS form of the boolean Function F, which is represented by the following
truth table 1
X Y Z F
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0

Q 7 Answer the following


A Expand term
i TCP/IP ii CDMA iii URL iv LAN 2
B Explain Star and Bus Topologies 2
C ABC Ltd has set up its new center at Delhi for its office and web based activities it has
4 bulidings shown in diagram
Center to center distance between Various building

Buld 1 to buld 2 50 m
Buld 2 to buld 3 150 m
Buld 3 to buld 4 25 m
Buld 1 to buld 4 170m
Buld 2 to buld 4 125 m
Buld 1 to buld 3 90 m

Number of computers inBulding

Buld1 25
Buld 2 50
Buld 3 125
Buld 4 10

Buld1 Buld 4
Buld2

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Buld 3

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

a) Suggest a cabel layout of connection between buldings. 1


b) Suggest the most suitable place (i.e bulding) to house the server of the
organization with the suitable reason 1
c) Suggest the placement of the follwing device with justification
i) Reapeater ii Hub/switch 1
d) the organization is planning to link its front office suitated in the city in a hilly
region where cable connection is not fesible, suggest an economic way to connect it with
reasonably high speed? 1

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

KENDRIYA VIDYALAYA SANGATHAN CHANDIGARH REGION


Class XII (COMPUTER SCIENCE)
Sample Question Paper –2

Time Duration 3 Hrs Max. Marks 70

Note
1 All question ae Compulsory
2 Programming Language C++
A Difference between logical and syntax error with example 2
B Name the Header file that shall be needed for the following code 1
void main()
{
char string[]=”Kendriya vidyalaya No 2 Ambala cantt”
Cout<<toupper(char(string))<<endl;
}
C Find the syntax error(s) if any, in the following code 2
#include<iostream.h>
void main()
{
int x;
cin<<x;
for(int y=0;y<10;y++);
cout>>x+y;
}
D Give the output of the following program. 2

#include<iostream.h>
#include<conio.h>
#include<string.h>
void strfunc(Char *str)
{
Int I,j,len:
len=strlen(str);
for (i=0;i<len;i++)
{
for (j=0;j<=I;j++)
{
cout<<str[j];
cout<<endl;
}
}
}
void main()
{

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

Strufunc(“Delhi”);
}
E Write a program to accept an integer number print the reverse of the number on
Screen (Note if number enter by user Iis 3456 the result is 6543) 3
F Given that 2
for( k=10;k<15;k++)
{
if (k<=12)
cout<<”twice k=”<<2*k<<endl<<endl;
else
cout<<”k=”<<k<<endl;
}

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

2 Answer the following


A What is this pointer? Give one example 2
B Answer the questions (i) and (ii) after going through the following class
class Interview
{

int Month;
public:
interview(int y )(month=y;} //constructor 1
interview(interview &t); //constructor 2
};

(i) Create an object, such that it invokes constructor


1

(ii) Write complete definition for constructor


2

(c) Define a class Tour in C++ with the description given below :
3

Private Members :
TCode of type string
No. ofAdults of type integer
No. ofKids of type integer
Kilometres of type integer
TotalFare of type float

Public Members :
• A constructor to assign initial values as follows :
TCode with the word “NULL”
No. of Adults as 0
No. of Kids as 0
Kilometres as 0
TotalFare as 0

• A function assignFare ( ) which calculates and assigns the value of


the data member TotalFare as follows
For each Adult
Fare(Rs) For Kilometres

500 >=1000
300 <1000&>=500
200 <500

For each Kid the above Fare will be 50% of the Fare mentioned in the
above table

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

For example :
If Kilometres is 850, NoofAdults = 2 and No.of Kids = 3
Then TotalFare should be calculated as
NumofAdults * 300 + NoofKids * 150
i.e. 2*300 + 3*150=1050

• A function EnterTour( ) to input the values of the data members


TCode, No. ofAdults, No.of Kids and Kilometres; and invoke the
Assign Fare( ) function.

• A function ShowTour( ) which displays the content of all the data


members for a Tour.

(d) Answer the questions (i) to (iv) based on the following code :
4
class Trainer
{
char TNo [5], TName [20], Specialisation [10];
int Days;
protected :
float Remuneration;
void AssignRem (float);
public:
Trainer ( );
void TEntry ( );
void TDisplay( );
};

class Learner
{
char Regno [10], LName [20], Program [10];
Protected :
int Attendance, Grade;
public:
Learner ( );
void LEntry ( );
void LDisplay ( );
};

class Institute : public Learner, public Trainer


{
char ICode[10], IName [20];
public:
Institute ( );
void IEntry ( );
void IDisplay ( );
};

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

(i) Which type of Inheritance is depicted by the above example?

(ii) Identify the member function(s) that cannot be called directly from the
objects of class Institute from the following
TEntry( )
LDisplay()
IEntry()

(iii) Write name of all the member(s) accessible from member functions of
class Institute.

(iv) If class Institute was derived privately from class Learner and privately
from class Trainer, then, name the member function(s) that could be
accessed through Objects of class Institute.

3 Answer the following


A Write a Function in C++ to print the sum of all the values which are divisible
by either 3 or are divisible by 5 present in a two dimensional array as the
arguments to the function 3

B An array Arr[15][20] is stored in the memory along the row with each element
occupying 4 bytes. Find out the Base Address and address of the element
Arr[3][2], if the element Arr[5][2] is stored at the address 1500. 4
C Write a function in C++ to perform a delete operation in a dynamically
allocated queue considering the following description : 4
struct Node
{
float U,V;
Node *Link;
};
class QUEUE
{
Node *Rear,*Front;
Public:
Queue()
{Rear=NULL;Front=NULL;}
void INSERT();
void DELETE();
~QUEUE();
};

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

(d) Write a function in C++ which accepts a 2D array of integers and its size as
arguments and displays the elements of both the diagonal is 0 in an Array
[Assuming the 2D Array to be a square matrix with odd dimension 3
i.e. 3×3, 5×5, 7×7 etc...]
Example, if the array content is
3 5 4
7 6 9
2 1 8
Output through the function should be :
0 5 0
7 0 9
0 1 0
(e) Let p be the postfix notation of expression : 2

7, 2, -, 1, 14, -, 1, 2, *, +, -, )
Q 4 Answer the Following
A Write modes of file ? 1
B Write a C++ program which reads one line at a time from the disk file Test.txt, and display it to
a monitor. Your program has to read al the contents of the file . assume the length of the line not
to exceed 80 charcters. You have to include all the header file if required. 2
C Assuming a binary file FUN.DAT is containing objects belonging to class Laughter. Write a
user definded function in C++ to add more objects belonging to class Laughter at the
bottom of it 3
Class Laugther
{
int idno;
char type[5];
char desc[255];
public :
void Newentry()
{
cin>>idno;
gets(type);
gets(desc);
}
Void showonscreen()
{
cout<<idno<<”,”<<type<<endl;
cout<<desc<<endl;
}
};
Q 5 Answer the Following
. A. Explain primary key and Candidate key? 2
Write SQL commands for b to e and write the output for f on the basis of the given

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

table.

Table: Supplier
Supp# SuppName Status City Qtysupp Item#
S1 Britannia C Delhi 10 12
S2 Mother C Mumbai 20 13
Dairy
S3 Nirula’s L Delhi 20 16
S4 Haldiram L Bangalore 40 14
S5 Bikaner L Jaipur 30 14
B Find the total quantity by all the suppliers 1
C Display a report listing supplier number,status and item number for all those suppliers
who have supplied quantity greater than or equal to 20 1
D Count the number of suppliers who,ve supplied quantity greater than or equal to 20 1
E Display a list of all suppliers supplying 14 and sorted by quantity supplied. 1
F Give the output of the following SQl queries. 2
i Select SUM(qtysupp) from supplier where item#=’14’;
ii Select MAX(qtysupp) from supplier;
iii Select supp# from supplier where status=’C’;
iv Select Count(Distinct City) from Supplier.

Q 6 Answer the following


A. Explain Absorption law in Boolean algebra. 2
B Write the equivalent Boolean Expression for the following Logic
Circuit. 2
C Reduce the following Boolean Expression from K Map
F(A,B,C,D)=π(0,2,7,8,10,15) 3
D Draw a Logic Circuit of Full adder 1

Q 7 Answer the Following


A Write Two advantages of Star and Bus topologies? 2
B Explain bridge and repeater ? 2
C (d) “Bhartiya Connectivity Association” is planning to spread their
offices in four major cities in India to provide regional IT
infrastructure support in the field of Education & Culture. The
company has planned to setup their head office in New Delhi in three
locations and have named their New Delhi offices as “Front Office”,
“Back Office” and “Work Office”. The company has three more
regional offices as “South Office”, “East Office” and “West Office”

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

located in other three major cities of India. A rough layout of the same
is as
follows :

4
Approximate distances between these offices as per network survey team
is
as follows:
Place From Place To Distance
BackOffice Front Office 10KM
Back Office Work Office 70 Meter
Back Office East Office 1291 KM
BackOffice West Office 790 KM
Back Office South Office 1952 KM

In continuation of the above, the company experts have planned to install


the
following number of computers in each of their offices :

Back Office 100


Front Office 20
Work Office 50
East Office 50
West Office 50
South Office 50

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer
Contact Dr. T.K. Jain (91-9414430763) regarding starting AFTERSCHO?ï OL centres in
your college / institution / organisation. Promote social entrepreneurship, join PGPSE and
become a social entrepreneur. Emial us : afterschoool@in.com

(i) Suggest network type (out of LAN, MAN, WAN) for connecting each
1
of the following set of their offices :
• Back Office and Work Office
• Back Office and South Office

(ii) Which device you will suggest to be procured by the company for
1
connecting all the computers with in each of their offices out of the
following devices?
• Switch/Hub
• Modem
• Telephone

(iii) Which of the following communication medium, you will suggest to


be
procured by the company for connecting their local offices in New
Delhi for very effective and fast communication?
1
• Telephone Cable
• Optical Fiber
• Ethernet Cable

(iv) Suggest a cable/wiring layout for connecting the company’s 1


local offices located in New Delhi. Also, suggest an effective method/
technologyfor connecting the company’s regional offices-”East Office”,
“West Office” and “South Office” with offices located in New Delhi.

AFTERSCHO?n OL CENTRE FOR SOCIAL ENTREPRENEURSHIP –


Let us Change the World – www.afterschoool.tk
Join PGPSE along with CS after class 12

Create PDF with GO2PDF for free, if you wish to remove this line, click here to buy Virtual PDF Printer

Вам также может понравиться