You are here: Home > Board Exams
All posts from

CBSE Academic Class XII Computer Science Sample Question Paper 2018-19 : cbseacademic.nic.in

Name of the Board : CBSE Academic
Class : XII STD
Document Type : Sample Question Paper
Subject : Computer Science
Paper : Class XII Sample Question Paper 2018-19
Year : 2018-19
Website : http://cbseacademic.nic.in/SQP_CLASSXII_2018_19.html

CBSE Academic Class XII Computer Science Question Paper

MM: 80
Time Allowed: 3hours

Related : CBSE Academic Class XII Commercial Art/ Bharatanatyam Sample Question Paper 2018-19 : www.pdfquestion.in/33455.html

General Instructions

(i) All the eight questions are compulsory which carry equal marks.
(ii) Answers to be written for question nos. 1 and 2 about 200 words each and for question nos. 3, 4 and 5 in about 100 words each. Question nos. 6, 7 and 8 are objective type.

Download Question Paper :
CS SQP :
https://www.pdfquestion.in/uploads/pdf2019/33472-CSSQP.pdf
CS MS :
https://www.pdfquestion.in/uploads/pdf2019/33472-CSMS.pdf

CS Sample Question Paper

General Instructions :
(a) All questions are compulsory.
(b) Programming Language with C++
(c) In Question 2(b, d) ,3 and 4 has internal choices.

Part – A

1 (a) Write the type of C++ Operators (Arithmetic, Logical, and Relational Operators) from thefollowing:
(i) !(ii) !=(iii) &&(iv) % (2)

(b) Observe the following program very carefully and write the name of those header file(s), which are essentially needed to compile and execute thefollowing program successfully:
void main()
{
char text[20], newText[20];
gets(text);
strcpy(newText,text);
for(int i=0;i<strlen(text);i++)
if(text[i] = =’A’)
text[i] = text[i]+2;
puts(text);
} (1)

(c) Rewrite the following C++ code after removing any/all Syntactical Error(s) with each correction underlined.
Note: Assume all required header files are already being included in the program.
#define float PI 3.14
void main( )
{
float R=4.5,H=1.5;
A=2*PI*R*H + 2*PIpow(R,2);
cout<<‘Area=’<<A<<endl;

(d) Find and write the output of the following C++ program code: Note: Assume all required header files are already being included in the program.
void main( )
{
int Ar[ ] = { 6 , 3 , 8 , 10 , 4 , 6 , 7} ;
int *Ptr = Ar , I ;
cout<<++*Ptr++ << ‘@’ ;
I = Ar[3] – Ar[2] ;
cout<<++*(Ptr+I)<<‘@'<<“\n” ;
cout<<++I + *Ptr++ << ‘@’ ;
cout<<*Ptr++ <<‘@'<< ‘\n’ ;
for( ; I >=0 ; I -=2)
cout<<Ar[I] << ‘@’ ;
} (3)

(e) Find and write the output of the following C++ program code:
typedef char STRING[80];
void MIXNOW(STRING S)
{
int Size=strlen(S);
for(int I=0;I<Size;I+=2)
{
char WS=S[I];
S[I]=S[I+1];
S[I+1]=WS;
}
for (I=1;I<Size;I+=2)
if (S[I]>=’M’ && S[I]<=’U’)
S[I]=’@’;
}
void main()
{
STRING Word=”CBSEEXAM2019”;
MIXNOW(Word);
cout<<Word<<endl;
}
(2)
(f)
Observe the following program and find out, which output(s) out of (i) to (iv) willbe expected from the program? What will be the minimum and the maximum value assigned to the variable Alter?
Note: Assume all required header files are already being included in the program.
void main( )
{
randomize();
int Ar[]={10,7}, N;
(2)

int Alter=random(2) + 10 ;
for (int C=0;C<2;C++)
{
N=random(2) ;
cout<<Ar[N] +Alter<<”#”;
}
}
(i) 21#20# (ii) 20#18#
(iii) 20#17# (iv) 21#17#

Par – B

(a) What is a copy constructor? Illustrate with a suitable C++ example. (2)
(b) Write the output of the following C++ code. Also, write the name of feature of Object Oriented Programming used in the following program jointly illustrated by the Function 1 to Function 4.
void My_fun ( ) // Function 1
{
for (int I=1 ; I<=50 ; I++) cout<< “-” ;
cout<<end1 ;
}
void My_fun (int N) // Function 2
{
for (int I=1 ; I<=N ; I++) cout<<“*” ;
cout<<end1 ;
}
void My_fun (int A, int B) // Function 3
{
for (int I=1. ;I<=B ;I++) cout <<A*I ;
cout<<end1 ;
}
void My_fun (char T, int N) // Function 4
{
for (int I=1 ; I<=N ; I++) cout<<T ;
cout<<end1;
}
void main ( )
{
int X=7, Y=4, Z=3;
char C=’#’ ;
My_fun (C,Y) ;
My_fun (X,Z) ;
} (2)

OR
(b) Write any four differences between Constructor and Destructor function with respect to object oriented programming.

(c) Define a class Ele_Bill in C++ with the following descriptions:
Private members:
Cname of type character array
Pnumber of type long
No_of_units of type integer
Amount of type float.
Calc_Amount( ) This member function should calculate the
amount as No_of_units*Cost .
Amount can be calculated according to the following conditions:
No_of_units Cost
First 50 units Free
Next 100 units 0.80 @ unit
Next 200 units 1.00 @ unit
Remaining units 1.20 @ unit
Public members:
* A function Accept( ) which allows user to enter Cname,
Pnumber, No_of_units and invoke function Calc_Amount().
* A function Display( ) to display the values of all the data members
on the screen. (4)

(d) Answer the questions (i) to (iv) based on the following:
class Faculty
{
int FCode;
protected:
char FName[20];
public:
Faculty();
void Enter();
void Show();
};
class Programme
{
int PID;
protected:
char Title[30];
public:
Programme();
void Commence();
void View();
};
class Schedule: public Programme, Faculty
{
int DD,MM,YYYY;

Part – C

(i) Write the names of all the member functions, which are directly accessible by the object S of class Schedule as declared in main() function.
(ii) Write the names of all the members, which are directly accessible by the memberfunction Start( ) of class Schedule.
(iii) Write Statement 2 to call function View( ) of class Programme from the object S of class Schedule.
(iv) What will be the order of execution of the constructors, when the object S of class Schedule is declared inside main()?
OR
Consider the following class State :
class State
{
protected :
int tp;
public :
State( ) { tp=0;}
void inctp( ) { tp++;};
int gettp(); { return tp; }
};
Write a code in C++ to publically derive another class ‘District’ with the following additional members derived in the public visibility mode.
Data Members :
Dname string
Distance float
Population long int
Member functions :
DINPUT( ) : To enter Dname, Distance and population
DOUTPUT( ) : To display the data members on the screen.

Part – D

Write a user defined function in C++ to find the sum of both left and right diagonal elements from a two dimensional array.
(b) Write a user-defined function EXTRA_ELE(int A[ ], int B[ ], int N) in C++ to find and display the extra element in Array A. Array A contains all the elements of array B but one more element extra. (Restriction: array elements are not in order)
Example If the elements of Array A is 14, 21, 5, 19, 8, 4, 23, 11
and the elements of Array B is 23, 8, 19, 4, 14, 11, 5
Then output will be 21 (3)
OR
Write a user defined function Reverse(int A[],int n) which accepts an integer array and its size as arguments(parameters) and reverse the array.
Example : if the array is 10,20,30,40,50 then reversed array is 50,40,30,20,10

(c) An array S[10] [30] is stored in the memory along the column with each of its element occupying 2 bytes. Find out the memory location of S[5][10], if element S[2][15] is stored at the location 8200. (3)
OR

An array A[30][10] is stored in the memory with each element requiring 4 bytes of storage ,if the base address of A is 4500 ,Find out memory locations of A[12][8], if the content is stored along the row.

(d) Write the definition of a member function Ins_Player() for a class CQUEUE in C++, to add a Player in a statically allocated circular queue of PLAYERs considering the following code is already written as a part of the program:
struct Player
{
long Pid;
char Pname[20]; (4)

Leave a Reply

How to add comment : 1) Type your comment below. 2) Type your name. 3) Post comment.

www.pdfquestion.in © 2021

Contact Us   Privacy Policy   SiteMap