CBSE Class 12 Computer Science Sample Paper 2018 Set B

Read and download PDF of CBSE Class 12 Computer Science Sample Paper 2018 Set B designed as per the latest curriculum and examination pattern for Class 12 issued by CBSE, NCERT and KVS. The latest Class 12 Computer Science Sample Papers have been provided with solutions so that the students can solve these practice papers and then compare their answers. This will help them to identify mistakes and improvement areas in Computer Science Class 12 which they need to study more to get better marks in Class 12 exams. After solving these guess papers also refer to solved Class 12 Computer Science Question Papers available on our website to build strong understanding of the subject

Sample Paper for Class 12 Computer Science Pdf

Students can refer to the below Class 12 Computer Science Sample Paper designed to help students understand the pattern of questions that will be asked in Class 12 exams. Please download CBSE Class 12 Computer Science Sample Paper 2018 Set B

Computer Science Class 12 Sample Paper

Section – A

1. (a) Find the correct identifiers out of the following, which can be used for naming variable, constants or functions in a C++ program : 

While, for, Float, new, 2ndName, A%B, Amount2, _Counter

(b) Observe the following program very carefully and write the names of those header file(s), which are essentially needed to compile and execute the following program successfully : 

typedef char TEXT[80];

void main()

{ TEXT Str[] = “Peace is supreme”; int Index=0;

while (Str[Index]!=’\0’)

if (isupper(Str[Index]))

Str[Index++]=’#’;

else

Str[Index++]=’*’;

puts(Str); }

(c) Observe the following C++ code very carefully and rewrite it after removing any/all syntactical errors with each correction underlined. 2

Note : Assume all required header files are already being included in the program.

#Define float Max=70.0;

Void main()

{

int Speed char Stop=’N’; cin>>Speed;

if Speed>Max

Stop=’Y’;

cout<<Stop<<end; }

(d) Write the output of the following C++ program code : 2

Note : Assume all required header files are already being included in the program.

void Position(int &C1,int C2=3)

{

C1+=2;

C2+=Y;

}

void main()

{

int P1=20, P2=4;

Position(P1);

cout<<P1<<”,”<<P2<<end1;

Position(P2,P1);

cout<<P1<<”,”<<P2<<end1;

}

(e) Write the output of the following C++ program code : 

Note : Assume all required header files are already being included in the program.

class Calc

{

char Grade; int Bonus;

public:

Calc() { Grade=’E’;Bonus=0;}

void Down(int G)

{ Grade–=G; }

void Up(int G)

{ Grade+=G; Bonus++; }

void Show()

{ cout<<Grade<<”#”<<Bonus<<end1; } };

void main()

{

Calc c;

C.Down(2);

C.Show();

C.Up(7);

C.Show();

C.Down(2);

C.Show();

}

(f) Study the following program and select the possible output(s) from the options (i) to (iv) following it. Also, write the maximum and the minimum values that can be assigned to the variable

NUM. 2

Note : Assume all required header files are already being included in the program.

– random(n) function generates an integer between 0 and n – 1.

void main()

{ randomize(); int NUM;

NUM=random(3)+2;

char TEXT[]=”ABCDEFGHIJK”;

for (int I=1;I<=NUM; I++)

{ for(int J=NUM; J<=7;J++)

cout<<TEXT[J];

cout<<end1;

} }

(i) FGHI (ii) BCDEFGH (iii) EFGH (iv) CDEFGH

FGHI BCDEFGH EFGH CDEFGH

FGHI EFGH

FGHI EFGH

2. (a) What is a copy constructor ? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it. 2

(b) Observe the following C++ code and answer the questions (i) and (ii) :

class Traveller

{ long PNR; char TName[20];

public : 

Traveller() //Function 1

{cout<<”Ready”<<end1;}

void Book(long P,char N[]) //Function 2

{ PNR = P; strcpy(TName, N); }

void Print() //Function 3

{ cout<<PNR << TName <<end1; }

~Traveller() //Function 4

{ cout<<”Booking cancelled!”<<end1; }

};

(i) Fill in the blank statements in Line 1 and Line 2 to execute Function 2 and Function 3

respectively in the following code : 1

void main()

{

Traveller T;

_________ //Line 1

_________ //Line 2

} //Stops here

(ii) Which function will be executed at }//Stopshere ? What is this function referred as ? 

(c) Write the definition of a class PIC in C++ with following description : 

Private Members

• Pno //Data member for Picture Number (an integer)

• Category //Data member for Picture Category (a string)

• Location //Data member for Exhibition Location (a string)

• FixLocation //A member function to assign Exhibition Location as per category

//as shown in the following table

Category Location

Classic Amina

Modern Jim Plaq

Antique Ustad Khan

Public Members

o Enter() //A function to allow user to enter values Pno,

//category and call FixLocation() function

o SeeAll() //A function to display all the data members

(d) Answer the questions (i) to (iv) based on the following : 

class Exterior

{ int OrderId; char Address[20];

protected:

float Advance;

public:

Exterior(); void Book(); void View();

};

class Paint : public Exterior

{

int WallArea, ColorCode;

protected: 

 

Please click the link below to download CBSE Class 12 Computer Science Sample Paper 2018 Set B

CBSE Class 12 Computer Science Sample Paper 2018 Set B

We hope you liked the above provided CBSE Class 12 Computer Science Sample Paper 2018 Set B. To get an understanding of the type of questions which were asked in exams, it is important for Class 12 students to understand the way sample Paper are set by teachers. Students can download the Sample Paper for Class 12 Computer Science which will be coming in the exams so that you can practise them and solve all types of questions that can be asked in exams. By doing CBSE Class 12 Computer Science Sample Paper 2018 Set B you will understand the regular questions and MCQ questions for Class 12 Computer Science which are always asked. You can download CBSE Class 12 Computer Science Sample Paper and Class 12 Computer Science Question Papers in PDF. You should attempt all the last year question paper for Class 12 and Class 12 Computer Science MCQ Test in examination conditions at home and then compare their answers with the solutions provided by our teachers.

Where can I download CBSE Class 12 Computer Science Sample Paper 2018 Set B in Pdf

You can download CBSE Class 12 Computer Science Sample Paper 2018 Set B from StudiesToday.com

How can I improve my scores by solving CBSE Class 12 Computer Science Sample Paper 2018 Set B

Regular practice of sample question paper given on studiestoday for CBSE Class 12 Computer Science Sample Paper 2018 Set B can help you to score better marks in exams

Are there any websites that offer free CBSE Class 12 Computer Science Sample Paper 2018 Set B

Yes, studiestoday.com provides all latest CBSE Class 12 Computer Science Sample Papers with answers based on the latest format issued for current academic session

Are mock CBSE Class 12 Computer Science Sample Paper 2018 Set B available in multiple languages

Yes, mock CBSE Class 12 Computer Science Sample Paper 2018 Set B are available in multiple languages, including English, Hindi