(Download) CBSE Class-12 Sample Paper And Marking Scheme 2015-16 : Computer Science

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

(Download) CBSE Class-12 Sample Paper And Marking Scheme 2015-16 : Computer Science

Sample Question Paper – Set II
Computer Science (083)
Class- XII (2015-16)


Time: 3hrs

M.M: 70
Instructions:

i. All Questions are Compulsory.
ii. Programming Language: Section A : C++
iii. Programming Language: Section B: Python
iv. Answer either Section A or B, and Section C is compulsory

Section : A (C++)


Q1 a. Define Macro with suitable example. 2
b. Which C++ header file (s) will be included to run /execute the following C++ code? 1
void main( )
{ int Last =26.5698742658;
cout<<setw(5)<<setprecision(9)<<Last; }
c. Rewrite the following program after removing any syntactical errors. Underline each
correction made. 2
#include<iostream.h>
void main( )
int A[10];
A=[3,2,5,4,7,9,10];
for( p = 0; p<=6; p++)
{ if(A[p]%2=0)
int S = S+A[p]; }
cout<<S; }
<--break--> d. Find the output of the following C++ program: 2
#include<iostream.h>
void repch(char s[])
{
for (int i=0;s[i]!='\0';i++)
{
if(((i%2)!=0) &&(s[i]!=s[i+1]))
{
s[i]='@';
}
else if (s[i]==s[i+1])
{
s[i+1]='!';
i++;
}
}
}
void main()
{
char str[]="SUCCESS";
cout<<”Original String”<<str
repch(str);
cout<<"Changed String"<<str;
}
e. Find the output of the following : 3
#include<iostream.h>
void switchover(int A[ ],int N, int split)
{
for(int K = 0; K<N; K++)
if(K<split)
A[K] += K;
else
A[K]*= K;
}
void display(int A[ ] ,int N)
{
for(int K = 0; K<N; K++)
(K%2== 0) ?cout<<A[K]<<"%" : cout<<A[K]<<endl;
}
void main( )
{ int H[ ] = {30,40,50,20,10,5};
switchover(H,6,3);
display(H,6);
}
f. Observe the following C++ code and find out , which out of the given options i) to iv) are the
expected correct output.Also assign the maximum and minimum value that can be assigned to
the variable ‘Go’. 2
void main()
{ int X [4] ={100,75,10,125};
int Go = random(2)+2;
for (inti = Go; i< 4; i++)
cout<<X[i]<<”$$”;
}
i. 100$$75 ii. 75$$10$$125$$ iii. 75$$10$$ iv.10$$125$
Q2a. Differentiate between data abstraction and data hiding. 2
b. Answer the questions (i) and (ii) after going through the following class : 2
class Exam
{
int Rollno;
char Cname[25];
float Marks ;
public :
Exam( ) //Function 1
{
Rollno = 0 ;
Cname=””;
Marks=0.0;
}
Exam(int Rno, char candname) //Function 2
{
Rollno = Rno ;
strcpy(Cname,candname);
}
~Exam( ) //Function 3
{
cout << “Result will be intimated shortly” << endl ;
}
void Display( ) //Function 4
{
cout << “Roll no :”<<Rollno;
cout<<”Name :” <<Cname;
cout <<” Marks:”<<Marks;
}
} ;
(i)Which OOP concept does Function 1 and Function 2 implement.Explain?
(ii)What is Function 3 called? When will it be invoked?
c. Define a class Candidate in C++ with the following specification : 4
Private Members :
A data members Rno(Registration Number) type long
A data member Cname of type string
A data members Agg_marks (Aggregate Marks) of type float
A data members Grade of type char
A member function setGrade () to find the grade as per the aggregate marks
obtained by the student. Equivalent aggregate marks range and the respective grade as shown
below.
Aggregate Marks Grade
>=80 A
Less than 80 and >=65 B
 

Click Here To Download Full Sample Paper

Click Here To Download Full Marking Scheme

<<Go Back To Main Page