CBSE Class 12 Computer Science Sample Paper 2018 Set 02

Download CBSE Class 12 Computer Science Sample Papers

Explore authentic exam practice materials through the CBSE Class 12 Computer Science Sample Paper 2018 Set 02. Tailored for Class 12 learners, utilizing these Computer Science sample papers ensures thorough preparation and strengthens time management skills before final CBSE evaluations.

Access CBSE Sample Papers and Solutions

Navigate directly to the solved Computer Science model papers using the digital viewer below. Each practice set includes detailed solutions, allowing students to instantly cross-check their work and identify areas requiring further revision.

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

Download CBSE Sample Papers: Class 12 Computer Science

Get Started with CBSE Class 12 Computer Science Sample Paper 2018 Set 02 (CBSE)

Access structured sample papers for Class 12 Computer Science. Solving the CBSE Class 12 Computer Science Sample Paper 2018 Set 02 provided above helps students understand official exam blueprints and tackle anticipated question formats with confidence.

Key Advantages of Solving CBSE Class 12 Computer Science Sample Paper 2018 Set 02

  • Exam Blueprint: Understand mark allocations and structural guidelines relevant to Class 12 evaluations.
  • Targeted Improvement: Identify weak areas in Class 12 Computer Science requiring focused revision.
  • Pacing & Precision: Practice mixed question formats to build execution speed and ensure timely paper completion.

Steps to Follow After Completing CBSE Class 12 Computer Science Sample Paper 2018 Set 02

  1. Review Solutions: Evaluate your completed papers using expert-verified guidance inside our solution sets.
  2. Target Weaknesses: Class 12 students should analyze missed questions to rectify conceptual misunderstandings.
  3. Deep Revision: Re-read sections in the NCERT book for Class 12 Computer Science to clear doubts before solving items again.

FAQs

Where can I download the PDF for CBSE Class 12 Computer Science Sample Paper 2018 Set 02?

You can download the complete PDF for CBSE Class 12 Computer Science Sample Paper 2018 Set 02 for free from StudiesToday.com. Our resources for Class 12 Computer Science are updated for the latest academic session and follow the official exam pattern.

Are solutions provided for CBSE Class 12 Computer Science Sample Paper 2018 Set 02?

Yes, CBSE Class 12 Computer Science Sample Paper 2018 Set 02 comes with detailed, teacher-verified solutions. We have provided step-by-step answers for Computer Science to help students of Class 12 understand correct methodology and marking scheme.

How can practicing CBSE Class 12 Computer Science Sample Paper 2018 Set 02 help in exam preparation?

Practicing this Computer Science paper helps in time management and identifying important topics. For Class 12, solving mock papers is the best way to gain confidence and reduce exam-day anxiety.

Is the CBSE Class 12 Computer Science Sample Paper 2018 Set 02 accessible on mobile and tablets?

Yes, all our study materials for Class 12 Computer Science are provided in a mobile-friendly PDF format. You can easily download CBSE Class 12 Computer Science Sample Paper 2018 Set 02 on your mobile device.