0% found this document useful (0 votes)
55 views7 pages

Guess Paper - 2012 Class - XII Subject - Computer Science: M.M.70 Time: 3 Hrs General Instructions

The document is a past year Class XII Computer Science exam paper from CBSE that contains 8 questions covering topics like: 1) Loop types, header files, error correction in C++ code. 2) Writing and analyzing C++ code involving classes, objects, constructors, inheritance. 3) Functions for binary search, address calculation, queue insertion in C++. 4) A function to find the sum of alternate elements of a 2D array. The paper tests the student's knowledge of important C++ concepts through different programming problems and questions.

Uploaded by

Anubha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views7 pages

Guess Paper - 2012 Class - XII Subject - Computer Science: M.M.70 Time: 3 Hrs General Instructions

The document is a past year Class XII Computer Science exam paper from CBSE that contains 8 questions covering topics like: 1) Loop types, header files, error correction in C++ code. 2) Writing and analyzing C++ code involving classes, objects, constructors, inheritance. 3) Functions for binary search, address calculation, queue insertion in C++. 4) A function to find the sum of alternate elements of a 2D array. The paper tests the student's knowledge of important C++ concepts through different programming problems and questions.

Uploaded by

Anubha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

http://www.cbseguess.

com/

Guess Paper – 2012


Class – XII
Subject – Computer Science

M.M.70 TIME: 3 HRS

GENERAL INSTRUCTIONS:
 Paper consists of 8 printed pages
 All questions are compulsory
 Programming language: C++

1. a) What is the difference between entry controlled loop and exit controlled loop?
Illustrate your answer with a C++ valid code. 2
b) Name the header files(s) used for successive compilation of the following: 1

void main( )
{
char word[30];
strcpy ( word, “Pre Board Examination “);
int s = strlen (word);
if(s%2= = 0)
cout<<setw(20)<<word;
}
c) Rewrite the following code after removing syntactical error(s), if any.
Underline each correction: 2
#include<iostream.h>
class Exams
{ char E_name[30], S_name[30];
int S_nos = 100;
float marks[3];

public:
Exams ( ) { };
void input( )
{ strcpy(E_name, “Computer Science “);
strcpy(S_name, “Amen Singhania “);
cin>>marks;
}
void output( )
{
cout<<”Name “<<S_name<<endl;
cout<<”S_Name”<<E_name<<endl;
cout<<”Number “<<S_nos<<endl;
}
};
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

void main( )
{ Exams E;
E.input; E.display; }

d) Write the output of the following code: 2


# include<iostream.h>
# include<ctype.h>

void manipulate( char string[], int & len)


{
for( int i=0; string[i]!=’\0’;i++)
{
if (isupper(string[i]))
string[i]= string[i]-2; len++;
else
if (isupper(string[i]))
string[i]=string[i+2]; −−len;
else
string[i]=’@’;
} }
void main( )
{ char word[]= “FuN UnliMiTEd!! “;
int length=strlen(word);
manipulate (word, length );
cout<<”Word “<<word<<”@”<<”Length”<<length;
}
e) Find the output 3
#include<iostream.h>
void in( int x, int y, int &z)
{ x+=y;
y--;
z*=(x-y);
}
void out( int z, int y, int &x)
{ x−= y;
y++;
z/=(x+y);
}
void main( )
{
int a= 20, b=30, c=10;
in (a, c, b);
cout<<a<<”#”<<b<<”#”<<c<<”#”<<endl;
out (b, c, a);
cout<<a<<”@”<<b<<”@”<<c<<”@”<<endl;
in (a, b, c);
cout<<a<<”$”<<b<<”$”<<c<<”$”<<endl;
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

}
f) Chose the correct alternative from the options (i)- (iv). Justify your answer. 2
#include<iostream.h>
#include<stdlib.h>
#define Getval (N) ((N%2 = =0)? N+1:N+2)
void main( )
{ randomize( );
int num= random(3)+3;
for( int I= num ; I<=num+2 ;I++)
cout<<Getval(I)<<’@’;
}
Options: a) 3@5@7@
b) 7@7@9@
c) 7@9@9@
d) 7@9@11@
2 a) Give differences between a copy and a parameterized constructor.
Also use a suitable C++ code to support your answer. 2
b) Answer questions 1 and 2 after going through the following class: 2
class game
{ char name[20]; int players;
public:
game (int, char*); // MODULE 1
game (game&); // MODULE 2
~game( ); // MODULE 3
};
1. Define MODULE 2 outside the class.
2. What is MODULE 3 known as? Which OOP concept do they imply?
c) Define a class STUDENT in C++ with the following specifications : 4

Class name Data Members Type


Student Std_name string
Std_rollno long
Marks float
Stream string
 A function Assign_stream( ) to assign stream on the following basis:
Marks Stream
300 and above Science
Between 250 and 300 Commerce
Between 200 and 250 Humanities
Below 200 NULL
Public Member Functions:
 A constructor to initialize data members with legal initial values.
 A function Initialize ( ) to input the values for the data members and invoke the Assign_stream ( ) function.
 A function to display the values of data members.
d) Answer Questions 1 to 4 after going through the following code: 4
class drama { char dname[20];
int Dduration;
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

protected:
char dactors[10][20];
public:
void enterdrama( );
void displaydrama( ); };

class realityshow { char rname[15];


int Rduration;
protected:
char Rparticipants[15][20];
public:
void enterreality ( );
void dispreality( ); };

class news{ int Nduration;


char nreader[10][15];
public:
void enternews( );
void dispnews( ) };
class tvprog : public drama, private realityshow, public news
{ char chnlgrp[20];
float pkgcost;
public:
void enterprog( );
void dispprog( ); };

1. Write the names of all members accessible from dispprog( ) of class tvprog.
2. Write name of all data members accessible from object of class tvprog.
3. Calculate size of an object of class tvprog.
4. Write the order for the call of the constructors when object of class tvprog is declared.

3. a) Write a user defined function in C++ to search a students record from the given
Array of structure using binary search technique. Assume the array is sorted in
descending order of the roll number. Assume the following definition : 3
struct Student{ char name[20];
long rollno;
};
b) An array X[5] [20] is stored in the memory along the column with each element
occupying 4 bytes of memory. Calculate the address of an element X [2] [15] if
the element X [3] [10] is stored at the address 2200. 3
c) Write a function in C++ to insert an element in a dynamically allocated Queue
containing the names of the countries. Give necessary declarations. 4
d) Write a user defined function int ALTERSUM(int B[], int N, int M) in C++ find
and return the sum of elements from all alternate elements of a 2-D array from
B[0] [0]. 2

EXAMPLE: 5 4 3
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

6 7 8
1 2 9
The function should add 5,3,7,1,9 and return 25.
e) Evaluate the following postfix expression showing the stack content: 2
False, True, NOT, OR, True, False, AND, OR.

4 a) Assume that a text file named “FILE.TXT” already contains some text written
into it. But while writing into the file, the word, “when” has been misspelled
“whn” everywhere in the file. Write a function named Corrections ( ) in C++ that
reads the file “FILE.TXT” and corrects the word “whn”. 2
b) Given a binary file BOOK.DAT containing records of the following type: 3
class user
{
char unmae[20], status; // A active I inactive.
int uid;
public:
void readdetails( );
void showdetails( );
char getstatus( )
{ return status };
void setstatus( char s )
{ status=s; };
int getid( )
{ return id };
};
Write a function which changes the status of all users with previous status as ‘I’ to ‘A’.
c) Considering the text file already contains the following word “September” (Double
Quotes are not the part of the text.) What will be the output of the following: 1

void main ( ) { ofstream fout(“NOTES.TXT”,ios::app);


fout<<”Exams “;
cout.tellp( );
fout.close( );
}

5. a) What do you understand by the following in a relation database : 2


i) Candidate Key ii) Project Operation.
b) Consider the following tables BOOKINGS and PACKAGE and write SQL
commands for (i) to (iv) and outputs for (v) and (vi). 6

BOOKINGS
Pcode Tourist Name Agency No_of_persons Tdate
P5 Raghavendra Voyager 2 23-dec-10
P2 Hardep Pristine 4 12-jan-11
P5 Shazia Go Now 6 25-dec-10
P6 Lizza Pristine 2 28-dec-10
P3 Diana Voyager 4 19-mar-11
www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

P6 Harshal Go Now 4 21-mar-11


P1 Rajiv Khanna Travels 12 12-apr-11
P1 Veena Sethi Voyager 5 01-apr-11
PACKAGE
Pcode Pname Per_Person_amt
P1 Kerala 20000
P2 Malaysia 35000
P3 Goa 56525
P4 Manali 15000
P5 Simla 12000
P6 Singapore 75450

a) Display the name of all the tourists, their travel dates, names of the places they are traveling to and the
total amount to be payed by each tourist.
b) Display the name of the agencies from the BOOKING table.
c) Arrange the contents of the table BOOKING in ascending order of travel date.
d) Display the maximum no_of_persons traveling of each travel agency.
e) SELECT Tourist Name, Agency, Pname from BOOKINGS, PACKAGE where BOOKINGS.Pcode =
PACKAGES.Pcode and Per_person_amt>3500;
f) SELECT Agency, sum(No_of_persons) from BOOKING group by agency having
sum(No_of_persons)>10;

6. a) State and verify De-Morgan’s Theorem in Boolean Algebra, algebraically 2


b) Write the equivalent Boolean expression for the following logic gate: 1

c) Evaluate using K-
Map: A, B, C, D
= π [2, 5, 3, 7, 9,
12, 15, 11, 10]
3
d) Convert the following into SOP form:

(P+Q+R) (P’+Q+R) (P’+Q’+R) (P+Q+R’).


7 a) Differentiate between Package switching and message switching technique. 1
b) Expand: a) CDMA b) XML 1

www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com
http://www.cbseguess.com/

c) Give any two examples of client Server Scripts. 1


d) Name the most important and safest network security technique. 1
e) A company has decided to network all its offices spread in 5 buildings as shown 4

B
A
E
D
MU
M

Centre to centre distance


between various Blocks: Number of Computers:

A and B 20 m
B and C 150 m
C and D 70 m
C and E 5000 Km
A and D 165 m
A 40
B and D 90 m
i) B 45
B and E 5000 km Suggest C 110
a
D 70
suitable Network connection.
j) Where do you think repeaters should be kept? E 60
k) Suggest an economic technology to provide internet accessibility to all buildings.
l) Building C has to be used for critical operations. It wants its PC to get maximum bandwidth. Which network
device should be used for this?
f) Differentiate between free and an open source software. 1
g) Differentiate between Trojan Horse and a worm. 1

Paper Submitted By:


Name amit
Email [email protected]
Phone No. 9872346700

www.cbseguess.com
Other Educational Portals
www.icseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com |
www.niosguess.com | www.iitguess.com

You might also like