0% found this document useful (0 votes)
109 views5 pages

All Questions Are Compulsory Programming Language: C++

(1) The document provides a sample computer science exam paper containing 7 sections with multiple questions in each section related to programming in C++, data structures, SQL, computer networks, and software concepts. (2) The paper tests knowledge of loops, functions, classes, arrays, pointers, structures, binary search, queues, stacks, relational databases, network devices, protocols, and security techniques. (3) It also includes questions on Boolean algebra, switching techniques, open source software, trojan horses versus worms, and designing a computer network for a multi-building organization.

Uploaded by

amit34521
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)
109 views5 pages

All Questions Are Compulsory Programming Language: C++

(1) The document provides a sample computer science exam paper containing 7 sections with multiple questions in each section related to programming in C++, data structures, SQL, computer networks, and software concepts. (2) The paper tests knowledge of loops, functions, classes, arrays, pointers, structures, binary search, queues, stacks, relational databases, network devices, protocols, and security techniques. (3) It also includes questions on Boolean algebra, switching techniques, open source software, trojan horses versus worms, and designing a computer network for a multi-building organization.

Uploaded by

amit34521
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/ 5

http://www.cbseguess.

com/
Guess Paper 2012
Class XII
Subject Computer Science
GENERAL INSTRUCTIONS:

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:
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:
#include<iostream.h>
struct A
{ int a, b;
};
void main ( )
{
int N=5;
A str [N] = (2, 5), *p;
p = str;
cout<<p.a<<p.b<<endl;
}

d) Write the output of the following code:


# include<iostream.h>
# include<ctype.h>
void change (char*state, int &s)
{
int b = s;
for (int x = 0; s>=0;x++, s)if ((x+s)%2)
*(state+x) = toupper(*(state+b-x));
}
void main ( )
{
char s[] = Punjab;
int b = strlen (s)1;
change (s, b);
cout<<s<<#<<b;
}

e) Find the output


#include<iostream.h>
void split(int array[], int breaks[])
{
for(int i=0;i<6;i++)
{ if(array[i]>=breaks[i]) array[i]+=10;
else
breaks[i]+=5;
}
}
void main( )
{
int arr[]={14,23,45,21,76,18};

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/
int change[10];
for(int i=0;i<6;i++)
{
if(arr[i]>arr[i+1])
change[i]=arr[i];
else
change[i]=arr[i+1];
}
split(arr,change);
for(i=0;i<6;i++)
{
if(i%2= =0) cout<<arr[i]+change[i]<<"#";
else
cout<<change[i]-arr[i]<<"*";
}
}
f) Chose the correct alternative from the options (i)- (iv). Justify your answer.
#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.
b) Answer questions 1 and 2 after going through the following class:
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 :

2
2

Class name
Student

Data Members
Type
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.
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/
d) Answer Questions 1 to 4 after going through the following code:
class drama {

class realityshow {

char dname[20];
int Dduration;
protected:
char dactors[10][20];
public:
void enterdrama( );
void displaydrama( );
char rname[15];
int Rduration;
protected:
char Rparticipants[15][20];
public:
void enterreality ( );
void dispreality( );

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( );

};

};

class news{

1.
2.
3.
4.

};

};

Write the names of all members accessible from dispprog( ) of class tvprog.
Write name of all data members accessible from object of class tvprog.
Calculate size of an object of class tvprog.
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 :
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.
c) Write a function in C++ to insert an element in a dynamically allocated Queue
containing the names of the countries. Give necessary declarations.
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]
EXAMPLE:
5
4
3
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:
False, True, NOT, OR, True, False, AND, OR.

3
4
2

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
Write a function named Corrections ( ) in C++ that reads the file FILE.TXT. and corrects
the word whn.
2
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/
b) Given a binary file BOOK.DAT containing records of the following type:
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:
void main ( ) {
fout<<Exams ;
cout.tellp( );

ofstream fout(NOTES.TXT,ios::app);
fout.close( );

}
5. a) What do you understand by the following in a relation database :
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).
Pcode
P5
P2
P5
P6
P3
P6
P1
P1
Pcode
P1
P2
P3
P4
P5
P6

BOOKINGS
Tourist Name
Raghavendra
Hardep
Shazia
Lizza
Diana
Harshal
Rajiv Khanna
Veena Sethi
PACKAGE
Pname
Kerala
Malaysia
Goa
Manali
Simla
Singapore

Agency
Voyager
Pristine
Go Now
Pristine
Voyager
Go Now
Travels
Voyager

No_of_persons
2
4
6
2
4
4
12
5

2
6
Tdate
23-dec-10
12-jan-11
25-dec-10
28-dec-10
19-mar-11
21-mar-11
12-apr-11
01-apr-11

Per_Person_amt
20000
35000
56525
15000
12000
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;
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. a) State and verify De-Morgans Theorem in Boolean Algebra, algebraically


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

2
1

c) Evaluate using K-Map: A, B, C, D = [2, 5, 3, 7, 9, 12, 15, 11, 10]


d) Convert the following into SOP form:
(P+Q+R) (P+Q+R) (P+Q+R) (P+Q+R).

3
2

7 a) Differentiate between Package switching and message switching technique.


b) Expand: a) CDMA
b) XML
c) Give any two examples of client Server Scripts.
d) Name the most important and safest network security technique.
e) A company has decided to network all its offices spread in 5 buildings as shown

1
1
1
1
4

B
A
C

Centre to centre distance


between various Blocks:

i)

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

B and D

90 m

B and E

5000 km

mumb
ai

Number of Computers:

Suggest

A
a suitable Network connection.
B
ii) Where do you think repeaters should be kept?
C
iii) Suggest an economic technology to provide internet
D
all buildings.
E
iv) Building C has to be used for critical operations. It
get maximum bandwidth. Which network device should be used for this?
f) Differentiate between free and an open source software.
g) Differentiate between Trojan Horse and a worm.

40
45
110
70
60

accessibility to
wants its PC to
1
1

Paper Submitted By:


Name: Ramesh Chopra
Email: ramesh.chopra49@yahoo.com
Phone No.
01614637810

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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy