SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
XII COMPUTER SCIENCE
CBSE Board - 2014
1(a) What is the difference between call by reference and call by value with respect to memory allocation? Give a
suitable example to illustrate using C++ code.
2
Ans.
Call By Value Call by reference
 Call by value is used to create a temporary copy
of the data which is transferred from the actual
parameter in the final parameter.
 Call by reference is used to share the same
memory location for actual and formal
parameters
 The changes done in the function in formal
parameter are not reflected back in the calling
environment.
 The changes done in the function are reflected
back in the calling environment.
Example:
void compute (int A, int & B)
{
A++;
B++;
cout<<“The function on display gives “;
cout<<“A = “<<A<<“&”<<“B=”<<B<<endl;
}
void main( )
{
int I=50, J=25;
cout<<“Initial of function call “<<endl;
cout<<“I=”<<I<<“&”<<“J=”<<J<<endl;
compute(I,J); cout<<“After the call of the function”<<endl;
cout<<“I=”<<I<<“&”<<“J=”<<J<<endl;
getch( );
}
(b) Observe the following C++ code and write the name(s) of the header file(s), which will be essentially required
to run it in a C++ compiler:
void main()
{
char CH, STR[20];
cin>>STR;
CH=toupper(STR[0]);
cout<<STR<<"starts with"<<CH<<endl;
}
1
Ans. (i) iostream.h
(ii) ctype.h
(c) Rewrite the following C++ code after removing all the syntax error(s), if present in the code. Make sure that
you underline each correction done by you in the code.
Important Note:
 Assume that all the required header files are already included, which are essential to run this code.
 The corrections made by you do not change the logic of the program.
typedef char[80] STR;
void main()
{
Txt STR;
gets(Txt);
cout<<Txt[0]<<'t<<Txt[2];
2
1
cbsecsnip.in
cout<<Txt<<endline;
}
Ans. typedef char STR[80];
void main()
{
STR Txt;
gets(Txt);
cout<<Txt[0]<<'t'<<Txt[2];
cout<<Txt<<endl;
}
(d) Obtain the output from the following C++ program as expected to appear on the screen after its execution.
Important Note:
All the desired header files are already included in the code, which are required to run the code.
void main()
{
char *Text="AJANTA";
int *P, Num[]={1, 5, 7, 9};
P=Num;
cout<<*P<<Text<<endl;
Text++;
P++;
cout<<*P<<Text<<endl;
}
2
Ans. 1AJANTA
5JANTA
(e) Obtain the output from the following C++ program, which will appear on the screen after its execution.
Important Note:
All the desired header files are already included in the code, which are required to run the code.
class Game
{
int Level, Score;
char Type;
public:
Game(char GType='P')
{
Level=1;
Score=0;
Type=GType;
}
void Play(int GS);
void Change();
void Show()
{
cout<<Type<<"@"<<Level<<endl;
cout<<Score<<endl;
}
};
void main()
{
Game A('G'), B;
B.Show();
A.Play(11);
3
2
cbsecsnip.in
A.Change();
B.Play(25);
A.Show();
B.Show();
}
void Game::Change()
{
Type=(Type=='P')?'G':'P';
}
void Game::Play(int GS)
{
Score+=GS;
if(Score>=30)
Level=3;
else if(Score>=20)
Level=2;
else
Level=1;
}
Ans: P@1
0
P@1
11
P@2
25
(f) Read the following C++ code carefully and find out, which out of the given options (i) to (iv) are the expected
correct output(s) of it. Also, write the maximum and minimum value that can be assigned to the variable Taker
used in the code:
void main()
{
int GuessMe[4]={100, 50, 200, 20};
int Taker=random(2)+2;
for(int Chance=0;Chance<Taker;Chance++)
cout<<GuessMe[Chance]<<"#";
}
(i) 100#
(ii) 50#200#
(iii) 100#50#200#
(iv) 100#50
2
Ans. 100#50#
Note: that if you run the following program, again and again, the same random numbers will be generated. That
is, TurboC always seeds the random number generator with the same starting number.
Therefore, the function "randomize()" may be used to seed the random number generator with a number which
is developed from the system clock, which of course, is always changing.
So, Taker always have 2 as random is generating 2 on every execution of code.
2(a) What is function overloading? Write an example using C++ to illustrate the concept of function overloading. 2
Ans. A function name having several definitions that are differentiable by the number or types of their arguments is
known as function overloading.
Example :
#include <iostream.h>
class printData
{
3
cbsecsnip.in
public:
void print(int i)
{
cout << "Printing int: " << i << endl;
}
void print(double f)
{
cout << "Printing float: " << f << endl;
}
void print(char* c)
{
cout << "Printing character: " << c << endl;
}
};
int main(void)
{
printData pd;
// Call print to print integer
pd.print(5);
// Call print to print float
pd.print(500.263);
// Call print to print character
pd.print("Hello C++");
return 0;
}
When the above code is compiled and executed, it produces following result:
Printing int: 5
Printing float: 500.263
Printing character: Hello C++
(b) Answer the questions (i) and (ii) after going through the following class:
class Hospital
{
int Pno, Dno;
public:
Hospital(int PN); //Function 1
Hospital(); //Function 2
Hospital(Hospital &H); //Function 3
void In(); //Function 4
void Disp(); //Function 5
};
void main()
{
Hospital H(20); //Statement 1
}
(i) Which of the functions out of Function 1, 2, 3, 4 or 5 will get executed when the Statement 1 is executed in
the above code?
(ii) Write a statement to declare a new object G with reference to already existing object H using Function 3.
2
Ans. (i) Function 1 will get executed when the statement 1 is executed in the above code.
(ii) Hospital G(H);
(c) Define a class Tourist in C++ with the following specification:
Data Members
• CN0 - to store Cab No
• Ctype - to store a chahracter 'A', 'B' or 'C' as City Type
4
4
cbsecsnip.in
• PerKM - to store per Kilo Meter charges
• Distance - to store Distance travelled (in Km)
Member Functions
• A constructor function to initialize CType as 'A' and CNo as '0000'
• A function CityCharges() to assign PerKM as per the following table:
CType Per KM
A 20
B 18
C 15
• A function RegisterCab() to allow administrator to enter the values for CNo and CType. Also, this function
should call CityCharges() to assign PerKM Charges.
• A function Display() to allow user to enter the value of Distance and display CNo, CType, PerKM,
PerKM*Distance (as Amount) on scree.
Ans. class Tourist
{
int CNO;
char Ctype;
int PerKM;
int Distance;
public:
Tourist()
{
CType='A';
CNO=0000;
}
void CityCharges()
{
if(CType=='A')
{
PerKM=20;
}
else if(CType=='B')
{
PerKM=18;
}
else if(CType=='C')
{
PerKM=15;
}
}
void RegisterCab()
{
cout<<"enter Cab No=";
cin>>CNO;
cout<<endl<<"enter city type=";
cin>>CType;
CityCharges();
}
void Display()
{
cout<<"enter distence in KM=";
cin>>Distance;
cout<<"Cab No ="<<CNO<<endl;
cout<<"city Type="<<CType<<endl;
5
cbsecsnip.in
cout<<"Kilo meter charges="<<PerKM<<endl;
cout<<"Amount is="<<PerKM*Distance;
}
};
(d) Consider the following C++ code and answer the questions from (i) to (iv):
class University
{
long Id;
char City[20];
protected:
char Country[20];
public:
University();
void Register();
void Display();
};
class Department: private University
{
long DCode[10];
char HOD[20];
protected:
double Budget;
public:
Department();
void Enter();
void Show();
};
class Student: public Department
{
long RollNo;
char Name[20];
public:
Student();
void Enroll();
void View();
};
(i) Which type of inheritance is shown in the above example?
(ii) Write the names of those member functions, which are directly accessed from the objects of class Student.
(iii) Write the names of those data members, which can be directly accessible from the member functions of
class Student.
(iv) Is it possible to directly call function Display() of class University from an object of class Department?
(Answer as Yes or No).
4
Ans. (i) Multilevel
(ii) void Enroll() and void view()
(iii) RollNo and Name[20]
(iv) No
3(a) Write code for a function void EvenOdd(int T[], int c) in C++, to add 1 in all the odd values and 2 in all the even
values of the array T.
Example : If the original content of the array T is
T[0] T[1] T[2] T[3] T[4]
35 12 16 69 26
The modified content will be:
3
6
cbsecsnip.in
T[0] T[1] T[2] T[3] T[4]
36 14 18 70 28
Ans. void EvenOdd(int T[], int c)
{
for(int i=0;i<c;++i)
{
if(T[i]%2==0)
T[i]+=2;
else
T[i]+=1;
}
}
(b) An array A[20][30] is stored along the row in the memory with each element requiring 4 bytes of storage. If the
base address of array A is 32000, find out the location of A[15][10]. Also, find the total number of elements
present in this array.
3
Ans. Base Address (i.e., address of A[0][0]) B = 32000
Element size w = 4 bytes
Rows, Columns in Array A R, C = 20, 30
Location of array A I, J = 15, 20
Address of A[I][J] = B + w * (I * C + J)
Address of A[15][20] = 32000 + 4 * (15 * 30 + 20)
= 33880
Total Number of elements present in array A is R * C i.e., 20 * 30 = 600
(c) Write a user-defined function AddEnd2(int A[][4], int N, int M) in C++ to find and display the sum of all the
values, which are ending with 2 (i.e., units place is 2).
for example if the content of array is:
22 16 12
19 5 2
The output should be
36
2
Ans. #include <conio.h>
#include <iostream.h>
void AddEnd2(int A[][3], int N, int M)
{
int num,sum=0;
for(int i=0; i<N; i++)
{
for(int j=0; j<M; j++)
{
num=A[i][j];
int last=num%10;
if(last==2)
sum=sum+num;
}
}
cout<<sum;
}
void main()
{
int arr[2][3] ={{22, 16, 12}, {19, 5, 2}};
clrscr();
7
cbsecsnip.in
AddEnd2(arr,2,3);
}
(d) Evaluate the following postfix expression. Show the status of stack after execution of each operation
separately:
T, F, NOT, AND, T, OR, F, AND
2
Ans.
token scanned from
postfix expression
Stack status ( bold letter shows the top of the
stack) after processing the scanned token
Operation performed
True True Push True
False True, False Push False
Not True, True Op1=pop() i.e. False
Push(NOT False) i.e. NOT False=True
And True Op2=pop() i.e. True
Op1=pop() i.e. True
Push(Op2 AND Op1) i.e. True AND
True=True
True True, True Push True
Or True Op2=pop() i.e. True
Op1=pop() i.e. True
Push(Op2 OR Op1) i.e. True OR
True=True
False True, False push False
And False Op2=pop() i.e. False
Op1=pop() i.e. True
Push(Op2 AND Op1) i.e. False AND
True=False
NULL Final result False Pop True and return False
(e) Write a function PUSHBOOK() in C++ to perform insert operation on a Dynamic Stack, which contains Book_no
and Book_Title. Consider the following definition of NODE, while writing your C++ code.
struct NODE
{
int Book_No;
char Book_Title[20];
NODE *Next;
};
4
Ans. struct NODE
{
int Book_No;
char Book_Title[20];
NODE *Next;
}*top, *newptr, *save;
void PUSHBOOK(NODE*);
void PUSHBOOK(NODE *np)
{
if(top==NULL)
top=np;
else
{
save=top;
top=np;
np->Next=save;
}
}
8
cbsecsnip.in
4(a) Fill in the blanks marked as Statement 1 and Statement 2, in the program segment given below with
appropriate functions for the required task.
class Agency
{
int ANo; //Agent Code
char AName[20]; //Agent Name
char Mobile[12]; //Agent Mobile
public:
void Enter(); //Function to enter details of agent
void Disp(); //Function to display details of agent
int RAno()
{
return ANo;
}
void UpdateMobile() //Function to update Mobile
{
cout<<"Updated Mobile";
gets(Mobile);
}
};
void AgentUpdate()
{
fstream F;
F.open("AGENT.DAT",ios::binary|ios::in|ios::out);
int Updt=0;
int UAno;
cout<<"Ano (Agent No - to update mobile):";
cin>>UAno;
Agency A;
while(!Updt && F.read((char*)&A,sizeof(A)))
{
if(A.RAno()==UAno)
{
//Statement 1 : To call the function to update Mobile No.
______________________________________;
//Statement 2: To reposition file pointer to re-write the updated object back in the file
______________________________________________;
F.write((char*)&A, sizeof(A));
Updt++;
}
}
if (Updt)
cout<<"Mobile Updated for Agent"<<UAno<<endl;
else
cout<<"Agent not in the Agency"<<endl;
F.close();
}
1
Ans. Statement 1: int Pos= F.tellg()
Statement 2: F.seekp(Pos-sizeof(A));
(b) Write a function AECount in C++, which should read each character of a text file NOTES.TXT, should count and
display the occurrence of alphabets A and E (including small cases a and e too).
2
9
cbsecsnip.in
Example:
If the file content is as follows:
CBSE enhanced its
CCE guideline further.
The AECount() function should display the output as
A:1
E:7
Ans. void AECount()
{
ifstream fin;
fin.open(“NOTES.TXT”, ios::in);
char word[50];
int c1=0,c2=0;
while(!fin.eof())
{
fin>>word;
if(strcmp(word,"A")==0||strcmp(word,"a")==0)
c1++;
if(strcmp(word,"E")==0||strcmp(word,"e")==0)
c2++;
}
cout<<"A :"<<c1;
cout<<"E :"<<c2;
fin.close();
}
(c) Assuming the class TOYS as declared below, write a function in C++ to read the objects of TOYS from binary file
TOYS.DAT and display those details of those TOYS, which are meant for childern of AgeRange "5 to 8".
class TOYS
{
int ToyCode;
char ToyName[10];
char AgeRange;
public:
void Enter()
{
cin>>ToyCode;
gets(ToyName);
gets(AgeRange);
}
void Display()
{
cout<<ToyCode<<":"<<ToyName<<endl;
cout<<AgeRange<<endl;
}
char* WhatAge()
{
return AgeRange;
}
};
3
Ans. void DisplayAgeRange()
10
cbsecsnip.in
{
TOYS C;
fstream fin;
fin.open(“TOYS.DAT”, ios:: binary | ios::in);
while(fin.read((char*)&C, sizeof(C)))
{
if(C.WhatAge()==5|| C.WhatAge()==6|| C.WhatAge()==7|| C.WhatAge()==8)
C.Display();
}
fin.close();
}
5(a) Explain the concept of Cartesian product between two tables, with the help of appropriate example.
NOTE: Answer the questions (b) and (c) on the basis of the following tables SHOPPE and ACCESSORIES.
Table: SHOPPE
Id SName Area
S001 ABC Computronics CP
S002 All Infotech Media GK II
S003 Tech Shoppe CP
S004 Geek Tenco Soft Nehru Place
S005 Hitech Tech Store Nehru Place
TABLE: ACCESSORIES
No Name Price Id
A01 Mother Board 12000 S01
A02 Hard Disk 5000 S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Mother Board 13000 S02
A06 Keyboard 400 S03
A07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T10 Hard Disk 4500 S03
Q. No. b iv SHOPPE and ACCESSORIES table ID values are totally different, answer prepared assuming values
are same in both the tables in Id attribute.
Q. No. c iv is wrong ACCESSORIES table does not have any attribute SNO , answer prepared assuming attribute
name ‘Id’ in query.
2
Ans. When you join two or more tables without any condition, it is called Cartesian product or Cross Join.
Example –
SELECT * FROM SHOPPE, ACCESSORIES;
(b) Write the SQL queries:
(i) To display Name and Price of all the Accessories in ascending order of their Price.
(ii) To display Id and SName of all Shoppe located in Nehru Place.
(iii) To display Minimum and Maximum Price of each Name of Accessories.
(iv) To display Name, Price of all Accessories and their respective SName where they are available.
4
Ans. (i) SELECT Name, Price FROM ACCESSORIES ORDER BY Price;
(ii) SELECT Id, SName FROM SHOPPE WHERE Area=’Nehru Place’;
(iii) SELECT Name, MAX(Price), MIN(Price) FROM ACCESSORIES ;
(iv) SELECT Name,Price,SName FROM ACCESSORIES A, SHOPPE S WHERE A.Id=S.Id;
(c) Write the output of the following SQL commands:
11
cbsecsnip.in
(i) SELECT DISTINCT NAME FROM ACCESSORIES WHERE PRICE>=5000;
(ii) SELECT AREA , COUNT(*) FROM SHOPPE GROUP BY AREA;
(iii) SELECT COUNT(DISTINCT AREA) FROM SHOPPE;
(iv) SELECT NAME, PRICE*0.05 DISCOUNT FROM ACCESSORIES WHERE SNO IN (‘S02’, ‘S03’);
2
Ans. (i) Name
Mother Board
Hard Disk
LCD
(ii) AREA COUNT
CP 2
GK II 1
Nehru Place 2
(iii) COUNT
3
(iv) NAME PRICE
Keyboard 25.00
Mother Board 650.00
Keyboard 20.00
Hard Disk 225.00
6(a) Name the law shown below and verify it using a truth table.
X+ X’.Y=X+Y
2
Ans.
X Y X’ X’.Y X+X’.Y X+Y
0 0 1 0 0 0
0 1 1 1 1 1
1 0 0 0 1 1
1 1 0 0 1 1
Prove algebraically that X + X’Y = X + Y.
L.H.S. = X + X’Y
= X.1 + X’Y (X . 1 = X property of 0 and 1)
= X(1 + Y) + X’Y (1 + Y = 1 property of 0 and 1)
= X + XY + X’Y
= X + Y(X + X’)
= X + Y.1 (X + X’ =1 complementarity law)
= X + Y (Y . 1 = Y property of 0 and 1)
= R.H.S. Hence proved.
(b) Obtain the Boolean Expression for the logic circuit shown below: 2
Ans. A’.B+(C+D’)’
(c) Write the Product of Sum from of the function F(X, Y, Z) for the following truth table representation of F:
X Y Z F
0 0 0 1
0 0 1 0
1
12
cbsecsnip.in
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
Ans.
X Y Z F MAX TERMS
0 0 0 1 X+Y+Z
0 0 1 0 X+Y+Z’
0 1 0 0 X+Y’+Z
0 1 1 1 X+Y’+Z’
1 0 0 0 X’+Y+Z
1 0 1 0 X’+Y+Z’
1 1 0 1 X’+Y’+Z
1 1 1 1 X’+Y’+Z’
Now by multiplying Maxterms for the output 0s, we get the desired product of sums expression which is
(X + Y + Z’)(X + Y’ + Z’)(X’+Y+Z)(X’ + Y + Z’)
(d) Obtain the minimal form for the following Boolean expression using K-Map :
F (A,B,C,D) = Σ (1, 3, 4, 5, 6, 7, 12, 13)
3
Ans.
A’B’C’D + A’B’CD + A’BC’D’ +A’BC’D+A’BCD +A’BCD’+ABC’D’ + ABC’D
A’B’D(C’+C) + A’BC’(D+D’) + A’BC(D+D’) +ABC’(D’+D)
A’B’D+A’BC’+A’BC+ABC’
A’B’D+A’B(C’+C) +ABC’
A’B’D+A’B+ABC’
A’D(B’+B) +ABC’
A’D+ABC’
D(A’+A)+BC’
D+BC’
7(a) Write two characteristics of Wi-Fi. 1
Ans. 1. It allows an electronic device to exchange data or connect to the internet wirelessly using microwaves.
2. Network range of wi-fi is very less than other network technologies like wired LAN.
(b) What is the difference between E-mail and Chat? 1
Ans.  Chat is a type of software while Email is a protocol
 Chat requires the permission of both parties while Email does not
 Chat is typically software dependent while Email is not
 Chat needs accounts on the same provider while Email does not
(c) Expand the following:
• GSM
• GPRS
1
Ans. GSM – Global System for Mobile Communications
13
cbsecsnip.in
GPRS –General Packet Radio Service
(d) Which type of network (out of LAN, PAN and MAN) is formed, when you connect two mobiles using Bluetooth
to transfer a video?
1
Ans. PAN
(e) Tech Up Corporation (TUC) is a professional consultancy company. The company is planning to set up their new
offices in Indian with its hub at Hyderabad. As a network adviser, you have to understand their requirement
and suggest to them the best available solutions. Their queries are mentioned as (i) to (iv) below.
Physical Locations of the blocks of TUC
Block to Block distances (in Mtrs.)
Block (From) Block (To) Distance
Human Resources Conference 60
Human Resources Finance 120
Conference Finance 60
Expected Number of Computers to be installed in each block
Block Computers
Human Resources 125
Finance 25
Conference 60
4
(i) What will the most appropriate block, where TUC should plan to install their server? 1
Ans. Human Resources will the most appropriate block, where TUC should plan to install their server.
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient
communication.
1
Ans.
(iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of
offices in Bangalore with its London base office?
• Infrared
1
14
cbsecsnip.in
• Satellite Link
• Ethernet Cable
Ans. Ethernet Cable
(iv) Which of the following devices will be suggested by you to connect each computer in each of the buildings?
• Gateway
• Switch
• Modem
1
Ans. Switch
(f) Write names of any two popular Open Source Software, which are used as Operating Systems. 1
Ans. Linux
OpenSolaris
(g) Write any two important characteristics of cloud computing. 1
Ans. Reduction of costs – unlike on-site hosting the price of deploying applications in the cloud can be less due to
lower hardware costs from more effective use of physical resources.
Choice of applications – This allows flexibility for cloud users to experiment and choose the best option for their
needs. Cloud computing also allows a business to use, access and pay only for what they use, with a fast
implementation time.
15
cbsecsnip.in

Contenu connexe

Tendances

Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperDeepak Singh
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th StudyChris Ohk
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Aman Deep
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsVishvjeet Yadav
 
C++ project
C++ projectC++ project
C++ projectSonu S S
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Deepak Singh
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
The present and the future of functional programming in c++
The present and the future of functional programming in c++The present and the future of functional programming in c++
The present and the future of functional programming in c++Alexander Granin
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperMalathi Senthil
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd StudyChris Ohk
 

Tendances (20)

Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Qno 1 (a)
Qno 1 (a)Qno 1 (a)
Qno 1 (a)
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
 
C++ project
C++ projectC++ project
C++ project
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
Implementing stack
Implementing stackImplementing stack
Implementing stack
 
C++ TUTORIAL 2
C++ TUTORIAL 2C++ TUTORIAL 2
C++ TUTORIAL 2
 
The present and the future of functional programming in c++
The present and the future of functional programming in c++The present and the future of functional programming in c++
The present and the future of functional programming in c++
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question Paper
 
Monadic parsers in C++
Monadic parsers in C++Monadic parsers in C++
Monadic parsers in C++
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
 
informatics practices practical file
informatics practices practical fileinformatics practices practical file
informatics practices practical file
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 

En vedette

98286173 government-polytechnic-lecturer-exam-paper-2012
98286173 government-polytechnic-lecturer-exam-paper-201298286173 government-polytechnic-lecturer-exam-paper-2012
98286173 government-polytechnic-lecturer-exam-paper-2012Bhavsingh Maloth
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
Appscpolytechniclecturersg.s.paper2007
Appscpolytechniclecturersg.s.paper2007Appscpolytechniclecturersg.s.paper2007
Appscpolytechniclecturersg.s.paper2007Bhavsingh Maloth
 
class 12 2014 maths solution set 1
class 12 2014 maths solution set 1class 12 2014 maths solution set 1
class 12 2014 maths solution set 1vandna123
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Deepak Singh
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical FileAshwin Francis
 
CBSE XII Communication And Network Concepts
CBSE XII Communication And Network ConceptsCBSE XII Communication And Network Concepts
CBSE XII Communication And Network ConceptsGuru Ji
 
Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 

En vedette (11)

98286173 government-polytechnic-lecturer-exam-paper-2012
98286173 government-polytechnic-lecturer-exam-paper-201298286173 government-polytechnic-lecturer-exam-paper-2012
98286173 government-polytechnic-lecturer-exam-paper-2012
 
TRB Govt polytechnic Exam may 2012
TRB Govt polytechnic Exam may 2012TRB Govt polytechnic Exam may 2012
TRB Govt polytechnic Exam may 2012
 
Polytechnic jan 6 2012
Polytechnic jan 6 2012Polytechnic jan 6 2012
Polytechnic jan 6 2012
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
Appscpolytechniclecturersg.s.paper2007
Appscpolytechniclecturersg.s.paper2007Appscpolytechniclecturersg.s.paper2007
Appscpolytechniclecturersg.s.paper2007
 
class 12 2014 maths solution set 1
class 12 2014 maths solution set 1class 12 2014 maths solution set 1
class 12 2014 maths solution set 1
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
CBSE XII Communication And Network Concepts
CBSE XII Communication And Network ConceptsCBSE XII Communication And Network Concepts
CBSE XII Communication And Network Concepts
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 

Similaire à 2014 computer science_question_paper

C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxssuser3cbb4c
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaonyash production
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Poonam Chopra
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbTUSHARGAURAV11
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbTUSHARGAURAV11
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical fileMitul Patel
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functionsTAlha MAlik
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Aman Deep
 

Similaire à 2014 computer science_question_paper (20)

C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
Managing console
Managing consoleManaging console
Managing console
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaon
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
C++ file
C++ fileC++ file
C++ file
 
C exam
C examC exam
C exam
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
 
C test
C testC test
C test
 
Qno 1 (c)
Qno 1 (c)Qno 1 (c)
Qno 1 (c)
 
pointers 1
pointers 1pointers 1
pointers 1
 
Quiz 10 cp_sol
Quiz 10 cp_solQuiz 10 cp_sol
Quiz 10 cp_sol
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functions
 
C++ file
C++ fileC++ file
C++ file
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 

Plus de vandna123

Mark &amp;-help
Mark &amp;-helpMark &amp;-help
Mark &amp;-helpvandna123
 
2014 Class12th chemistry set 1
2014 Class12th chemistry set 12014 Class12th chemistry set 1
2014 Class12th chemistry set 1vandna123
 
Cbs board xii-physics 2014 set 3
Cbs board xii-physics 2014 set 3Cbs board xii-physics 2014 set 3
Cbs board xii-physics 2014 set 3vandna123
 
12th physics-solution set 3
12th physics-solution set 312th physics-solution set 3
12th physics-solution set 3vandna123
 
12 cbse-maths-2014-solution set 1
12 cbse-maths-2014-solution set 1 12 cbse-maths-2014-solution set 1
12 cbse-maths-2014-solution set 1 vandna123
 
12 cbse-maths-2014-paper set 1 unsolved
12 cbse-maths-2014-paper set 1 unsolved12 cbse-maths-2014-paper set 1 unsolved
12 cbse-maths-2014-paper set 1 unsolvedvandna123
 
2011 bitsat-solved-paper
2011 bitsat-solved-paper2011 bitsat-solved-paper
2011 bitsat-solved-papervandna123
 

Plus de vandna123 (7)

Mark &amp;-help
Mark &amp;-helpMark &amp;-help
Mark &amp;-help
 
2014 Class12th chemistry set 1
2014 Class12th chemistry set 12014 Class12th chemistry set 1
2014 Class12th chemistry set 1
 
Cbs board xii-physics 2014 set 3
Cbs board xii-physics 2014 set 3Cbs board xii-physics 2014 set 3
Cbs board xii-physics 2014 set 3
 
12th physics-solution set 3
12th physics-solution set 312th physics-solution set 3
12th physics-solution set 3
 
12 cbse-maths-2014-solution set 1
12 cbse-maths-2014-solution set 1 12 cbse-maths-2014-solution set 1
12 cbse-maths-2014-solution set 1
 
12 cbse-maths-2014-paper set 1 unsolved
12 cbse-maths-2014-paper set 1 unsolved12 cbse-maths-2014-paper set 1 unsolved
12 cbse-maths-2014-paper set 1 unsolved
 
2011 bitsat-solved-paper
2011 bitsat-solved-paper2011 bitsat-solved-paper
2011 bitsat-solved-paper
 

Dernier

Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Dernier (20)

Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

2014 computer science_question_paper

  • 1. XII COMPUTER SCIENCE CBSE Board - 2014 1(a) What is the difference between call by reference and call by value with respect to memory allocation? Give a suitable example to illustrate using C++ code. 2 Ans. Call By Value Call by reference  Call by value is used to create a temporary copy of the data which is transferred from the actual parameter in the final parameter.  Call by reference is used to share the same memory location for actual and formal parameters  The changes done in the function in formal parameter are not reflected back in the calling environment.  The changes done in the function are reflected back in the calling environment. Example: void compute (int A, int & B) { A++; B++; cout<<“The function on display gives “; cout<<“A = “<<A<<“&”<<“B=”<<B<<endl; } void main( ) { int I=50, J=25; cout<<“Initial of function call “<<endl; cout<<“I=”<<I<<“&”<<“J=”<<J<<endl; compute(I,J); cout<<“After the call of the function”<<endl; cout<<“I=”<<I<<“&”<<“J=”<<J<<endl; getch( ); } (b) Observe the following C++ code and write the name(s) of the header file(s), which will be essentially required to run it in a C++ compiler: void main() { char CH, STR[20]; cin>>STR; CH=toupper(STR[0]); cout<<STR<<"starts with"<<CH<<endl; } 1 Ans. (i) iostream.h (ii) ctype.h (c) Rewrite the following C++ code after removing all the syntax error(s), if present in the code. Make sure that you underline each correction done by you in the code. Important Note:  Assume that all the required header files are already included, which are essential to run this code.  The corrections made by you do not change the logic of the program. typedef char[80] STR; void main() { Txt STR; gets(Txt); cout<<Txt[0]<<'t<<Txt[2]; 2 1 cbsecsnip.in
  • 2. cout<<Txt<<endline; } Ans. typedef char STR[80]; void main() { STR Txt; gets(Txt); cout<<Txt[0]<<'t'<<Txt[2]; cout<<Txt<<endl; } (d) Obtain the output from the following C++ program as expected to appear on the screen after its execution. Important Note: All the desired header files are already included in the code, which are required to run the code. void main() { char *Text="AJANTA"; int *P, Num[]={1, 5, 7, 9}; P=Num; cout<<*P<<Text<<endl; Text++; P++; cout<<*P<<Text<<endl; } 2 Ans. 1AJANTA 5JANTA (e) Obtain the output from the following C++ program, which will appear on the screen after its execution. Important Note: All the desired header files are already included in the code, which are required to run the code. class Game { int Level, Score; char Type; public: Game(char GType='P') { Level=1; Score=0; Type=GType; } void Play(int GS); void Change(); void Show() { cout<<Type<<"@"<<Level<<endl; cout<<Score<<endl; } }; void main() { Game A('G'), B; B.Show(); A.Play(11); 3 2 cbsecsnip.in
  • 3. A.Change(); B.Play(25); A.Show(); B.Show(); } void Game::Change() { Type=(Type=='P')?'G':'P'; } void Game::Play(int GS) { Score+=GS; if(Score>=30) Level=3; else if(Score>=20) Level=2; else Level=1; } Ans: P@1 0 P@1 11 P@2 25 (f) Read the following C++ code carefully and find out, which out of the given options (i) to (iv) are the expected correct output(s) of it. Also, write the maximum and minimum value that can be assigned to the variable Taker used in the code: void main() { int GuessMe[4]={100, 50, 200, 20}; int Taker=random(2)+2; for(int Chance=0;Chance<Taker;Chance++) cout<<GuessMe[Chance]<<"#"; } (i) 100# (ii) 50#200# (iii) 100#50#200# (iv) 100#50 2 Ans. 100#50# Note: that if you run the following program, again and again, the same random numbers will be generated. That is, TurboC always seeds the random number generator with the same starting number. Therefore, the function "randomize()" may be used to seed the random number generator with a number which is developed from the system clock, which of course, is always changing. So, Taker always have 2 as random is generating 2 on every execution of code. 2(a) What is function overloading? Write an example using C++ to illustrate the concept of function overloading. 2 Ans. A function name having several definitions that are differentiable by the number or types of their arguments is known as function overloading. Example : #include <iostream.h> class printData { 3 cbsecsnip.in
  • 4. public: void print(int i) { cout << "Printing int: " << i << endl; } void print(double f) { cout << "Printing float: " << f << endl; } void print(char* c) { cout << "Printing character: " << c << endl; } }; int main(void) { printData pd; // Call print to print integer pd.print(5); // Call print to print float pd.print(500.263); // Call print to print character pd.print("Hello C++"); return 0; } When the above code is compiled and executed, it produces following result: Printing int: 5 Printing float: 500.263 Printing character: Hello C++ (b) Answer the questions (i) and (ii) after going through the following class: class Hospital { int Pno, Dno; public: Hospital(int PN); //Function 1 Hospital(); //Function 2 Hospital(Hospital &H); //Function 3 void In(); //Function 4 void Disp(); //Function 5 }; void main() { Hospital H(20); //Statement 1 } (i) Which of the functions out of Function 1, 2, 3, 4 or 5 will get executed when the Statement 1 is executed in the above code? (ii) Write a statement to declare a new object G with reference to already existing object H using Function 3. 2 Ans. (i) Function 1 will get executed when the statement 1 is executed in the above code. (ii) Hospital G(H); (c) Define a class Tourist in C++ with the following specification: Data Members • CN0 - to store Cab No • Ctype - to store a chahracter 'A', 'B' or 'C' as City Type 4 4 cbsecsnip.in
  • 5. • PerKM - to store per Kilo Meter charges • Distance - to store Distance travelled (in Km) Member Functions • A constructor function to initialize CType as 'A' and CNo as '0000' • A function CityCharges() to assign PerKM as per the following table: CType Per KM A 20 B 18 C 15 • A function RegisterCab() to allow administrator to enter the values for CNo and CType. Also, this function should call CityCharges() to assign PerKM Charges. • A function Display() to allow user to enter the value of Distance and display CNo, CType, PerKM, PerKM*Distance (as Amount) on scree. Ans. class Tourist { int CNO; char Ctype; int PerKM; int Distance; public: Tourist() { CType='A'; CNO=0000; } void CityCharges() { if(CType=='A') { PerKM=20; } else if(CType=='B') { PerKM=18; } else if(CType=='C') { PerKM=15; } } void RegisterCab() { cout<<"enter Cab No="; cin>>CNO; cout<<endl<<"enter city type="; cin>>CType; CityCharges(); } void Display() { cout<<"enter distence in KM="; cin>>Distance; cout<<"Cab No ="<<CNO<<endl; cout<<"city Type="<<CType<<endl; 5 cbsecsnip.in
  • 6. cout<<"Kilo meter charges="<<PerKM<<endl; cout<<"Amount is="<<PerKM*Distance; } }; (d) Consider the following C++ code and answer the questions from (i) to (iv): class University { long Id; char City[20]; protected: char Country[20]; public: University(); void Register(); void Display(); }; class Department: private University { long DCode[10]; char HOD[20]; protected: double Budget; public: Department(); void Enter(); void Show(); }; class Student: public Department { long RollNo; char Name[20]; public: Student(); void Enroll(); void View(); }; (i) Which type of inheritance is shown in the above example? (ii) Write the names of those member functions, which are directly accessed from the objects of class Student. (iii) Write the names of those data members, which can be directly accessible from the member functions of class Student. (iv) Is it possible to directly call function Display() of class University from an object of class Department? (Answer as Yes or No). 4 Ans. (i) Multilevel (ii) void Enroll() and void view() (iii) RollNo and Name[20] (iv) No 3(a) Write code for a function void EvenOdd(int T[], int c) in C++, to add 1 in all the odd values and 2 in all the even values of the array T. Example : If the original content of the array T is T[0] T[1] T[2] T[3] T[4] 35 12 16 69 26 The modified content will be: 3 6 cbsecsnip.in
  • 7. T[0] T[1] T[2] T[3] T[4] 36 14 18 70 28 Ans. void EvenOdd(int T[], int c) { for(int i=0;i<c;++i) { if(T[i]%2==0) T[i]+=2; else T[i]+=1; } } (b) An array A[20][30] is stored along the row in the memory with each element requiring 4 bytes of storage. If the base address of array A is 32000, find out the location of A[15][10]. Also, find the total number of elements present in this array. 3 Ans. Base Address (i.e., address of A[0][0]) B = 32000 Element size w = 4 bytes Rows, Columns in Array A R, C = 20, 30 Location of array A I, J = 15, 20 Address of A[I][J] = B + w * (I * C + J) Address of A[15][20] = 32000 + 4 * (15 * 30 + 20) = 33880 Total Number of elements present in array A is R * C i.e., 20 * 30 = 600 (c) Write a user-defined function AddEnd2(int A[][4], int N, int M) in C++ to find and display the sum of all the values, which are ending with 2 (i.e., units place is 2). for example if the content of array is: 22 16 12 19 5 2 The output should be 36 2 Ans. #include <conio.h> #include <iostream.h> void AddEnd2(int A[][3], int N, int M) { int num,sum=0; for(int i=0; i<N; i++) { for(int j=0; j<M; j++) { num=A[i][j]; int last=num%10; if(last==2) sum=sum+num; } } cout<<sum; } void main() { int arr[2][3] ={{22, 16, 12}, {19, 5, 2}}; clrscr(); 7 cbsecsnip.in
  • 8. AddEnd2(arr,2,3); } (d) Evaluate the following postfix expression. Show the status of stack after execution of each operation separately: T, F, NOT, AND, T, OR, F, AND 2 Ans. token scanned from postfix expression Stack status ( bold letter shows the top of the stack) after processing the scanned token Operation performed True True Push True False True, False Push False Not True, True Op1=pop() i.e. False Push(NOT False) i.e. NOT False=True And True Op2=pop() i.e. True Op1=pop() i.e. True Push(Op2 AND Op1) i.e. True AND True=True True True, True Push True Or True Op2=pop() i.e. True Op1=pop() i.e. True Push(Op2 OR Op1) i.e. True OR True=True False True, False push False And False Op2=pop() i.e. False Op1=pop() i.e. True Push(Op2 AND Op1) i.e. False AND True=False NULL Final result False Pop True and return False (e) Write a function PUSHBOOK() in C++ to perform insert operation on a Dynamic Stack, which contains Book_no and Book_Title. Consider the following definition of NODE, while writing your C++ code. struct NODE { int Book_No; char Book_Title[20]; NODE *Next; }; 4 Ans. struct NODE { int Book_No; char Book_Title[20]; NODE *Next; }*top, *newptr, *save; void PUSHBOOK(NODE*); void PUSHBOOK(NODE *np) { if(top==NULL) top=np; else { save=top; top=np; np->Next=save; } } 8 cbsecsnip.in
  • 9. 4(a) Fill in the blanks marked as Statement 1 and Statement 2, in the program segment given below with appropriate functions for the required task. class Agency { int ANo; //Agent Code char AName[20]; //Agent Name char Mobile[12]; //Agent Mobile public: void Enter(); //Function to enter details of agent void Disp(); //Function to display details of agent int RAno() { return ANo; } void UpdateMobile() //Function to update Mobile { cout<<"Updated Mobile"; gets(Mobile); } }; void AgentUpdate() { fstream F; F.open("AGENT.DAT",ios::binary|ios::in|ios::out); int Updt=0; int UAno; cout<<"Ano (Agent No - to update mobile):"; cin>>UAno; Agency A; while(!Updt && F.read((char*)&A,sizeof(A))) { if(A.RAno()==UAno) { //Statement 1 : To call the function to update Mobile No. ______________________________________; //Statement 2: To reposition file pointer to re-write the updated object back in the file ______________________________________________; F.write((char*)&A, sizeof(A)); Updt++; } } if (Updt) cout<<"Mobile Updated for Agent"<<UAno<<endl; else cout<<"Agent not in the Agency"<<endl; F.close(); } 1 Ans. Statement 1: int Pos= F.tellg() Statement 2: F.seekp(Pos-sizeof(A)); (b) Write a function AECount in C++, which should read each character of a text file NOTES.TXT, should count and display the occurrence of alphabets A and E (including small cases a and e too). 2 9 cbsecsnip.in
  • 10. Example: If the file content is as follows: CBSE enhanced its CCE guideline further. The AECount() function should display the output as A:1 E:7 Ans. void AECount() { ifstream fin; fin.open(“NOTES.TXT”, ios::in); char word[50]; int c1=0,c2=0; while(!fin.eof()) { fin>>word; if(strcmp(word,"A")==0||strcmp(word,"a")==0) c1++; if(strcmp(word,"E")==0||strcmp(word,"e")==0) c2++; } cout<<"A :"<<c1; cout<<"E :"<<c2; fin.close(); } (c) Assuming the class TOYS as declared below, write a function in C++ to read the objects of TOYS from binary file TOYS.DAT and display those details of those TOYS, which are meant for childern of AgeRange "5 to 8". class TOYS { int ToyCode; char ToyName[10]; char AgeRange; public: void Enter() { cin>>ToyCode; gets(ToyName); gets(AgeRange); } void Display() { cout<<ToyCode<<":"<<ToyName<<endl; cout<<AgeRange<<endl; } char* WhatAge() { return AgeRange; } }; 3 Ans. void DisplayAgeRange() 10 cbsecsnip.in
  • 11. { TOYS C; fstream fin; fin.open(“TOYS.DAT”, ios:: binary | ios::in); while(fin.read((char*)&C, sizeof(C))) { if(C.WhatAge()==5|| C.WhatAge()==6|| C.WhatAge()==7|| C.WhatAge()==8) C.Display(); } fin.close(); } 5(a) Explain the concept of Cartesian product between two tables, with the help of appropriate example. NOTE: Answer the questions (b) and (c) on the basis of the following tables SHOPPE and ACCESSORIES. Table: SHOPPE Id SName Area S001 ABC Computronics CP S002 All Infotech Media GK II S003 Tech Shoppe CP S004 Geek Tenco Soft Nehru Place S005 Hitech Tech Store Nehru Place TABLE: ACCESSORIES No Name Price Id A01 Mother Board 12000 S01 A02 Hard Disk 5000 S01 A03 Keyboard 500 S02 A04 Mouse 300 S01 A05 Mother Board 13000 S02 A06 Keyboard 400 S03 A07 LCD 6000 S04 T08 LCD 5500 S05 T09 Mouse 350 S05 T10 Hard Disk 4500 S03 Q. No. b iv SHOPPE and ACCESSORIES table ID values are totally different, answer prepared assuming values are same in both the tables in Id attribute. Q. No. c iv is wrong ACCESSORIES table does not have any attribute SNO , answer prepared assuming attribute name ‘Id’ in query. 2 Ans. When you join two or more tables without any condition, it is called Cartesian product or Cross Join. Example – SELECT * FROM SHOPPE, ACCESSORIES; (b) Write the SQL queries: (i) To display Name and Price of all the Accessories in ascending order of their Price. (ii) To display Id and SName of all Shoppe located in Nehru Place. (iii) To display Minimum and Maximum Price of each Name of Accessories. (iv) To display Name, Price of all Accessories and their respective SName where they are available. 4 Ans. (i) SELECT Name, Price FROM ACCESSORIES ORDER BY Price; (ii) SELECT Id, SName FROM SHOPPE WHERE Area=’Nehru Place’; (iii) SELECT Name, MAX(Price), MIN(Price) FROM ACCESSORIES ; (iv) SELECT Name,Price,SName FROM ACCESSORIES A, SHOPPE S WHERE A.Id=S.Id; (c) Write the output of the following SQL commands: 11 cbsecsnip.in
  • 12. (i) SELECT DISTINCT NAME FROM ACCESSORIES WHERE PRICE>=5000; (ii) SELECT AREA , COUNT(*) FROM SHOPPE GROUP BY AREA; (iii) SELECT COUNT(DISTINCT AREA) FROM SHOPPE; (iv) SELECT NAME, PRICE*0.05 DISCOUNT FROM ACCESSORIES WHERE SNO IN (‘S02’, ‘S03’); 2 Ans. (i) Name Mother Board Hard Disk LCD (ii) AREA COUNT CP 2 GK II 1 Nehru Place 2 (iii) COUNT 3 (iv) NAME PRICE Keyboard 25.00 Mother Board 650.00 Keyboard 20.00 Hard Disk 225.00 6(a) Name the law shown below and verify it using a truth table. X+ X’.Y=X+Y 2 Ans. X Y X’ X’.Y X+X’.Y X+Y 0 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 1 1 Prove algebraically that X + X’Y = X + Y. L.H.S. = X + X’Y = X.1 + X’Y (X . 1 = X property of 0 and 1) = X(1 + Y) + X’Y (1 + Y = 1 property of 0 and 1) = X + XY + X’Y = X + Y(X + X’) = X + Y.1 (X + X’ =1 complementarity law) = X + Y (Y . 1 = Y property of 0 and 1) = R.H.S. Hence proved. (b) Obtain the Boolean Expression for the logic circuit shown below: 2 Ans. A’.B+(C+D’)’ (c) Write the Product of Sum from of the function F(X, Y, Z) for the following truth table representation of F: X Y Z F 0 0 0 1 0 0 1 0 1 12 cbsecsnip.in
  • 13. 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 Ans. X Y Z F MAX TERMS 0 0 0 1 X+Y+Z 0 0 1 0 X+Y+Z’ 0 1 0 0 X+Y’+Z 0 1 1 1 X+Y’+Z’ 1 0 0 0 X’+Y+Z 1 0 1 0 X’+Y+Z’ 1 1 0 1 X’+Y’+Z 1 1 1 1 X’+Y’+Z’ Now by multiplying Maxterms for the output 0s, we get the desired product of sums expression which is (X + Y + Z’)(X + Y’ + Z’)(X’+Y+Z)(X’ + Y + Z’) (d) Obtain the minimal form for the following Boolean expression using K-Map : F (A,B,C,D) = Σ (1, 3, 4, 5, 6, 7, 12, 13) 3 Ans. A’B’C’D + A’B’CD + A’BC’D’ +A’BC’D+A’BCD +A’BCD’+ABC’D’ + ABC’D A’B’D(C’+C) + A’BC’(D+D’) + A’BC(D+D’) +ABC’(D’+D) A’B’D+A’BC’+A’BC+ABC’ A’B’D+A’B(C’+C) +ABC’ A’B’D+A’B+ABC’ A’D(B’+B) +ABC’ A’D+ABC’ D(A’+A)+BC’ D+BC’ 7(a) Write two characteristics of Wi-Fi. 1 Ans. 1. It allows an electronic device to exchange data or connect to the internet wirelessly using microwaves. 2. Network range of wi-fi is very less than other network technologies like wired LAN. (b) What is the difference between E-mail and Chat? 1 Ans.  Chat is a type of software while Email is a protocol  Chat requires the permission of both parties while Email does not  Chat is typically software dependent while Email is not  Chat needs accounts on the same provider while Email does not (c) Expand the following: • GSM • GPRS 1 Ans. GSM – Global System for Mobile Communications 13 cbsecsnip.in
  • 14. GPRS –General Packet Radio Service (d) Which type of network (out of LAN, PAN and MAN) is formed, when you connect two mobiles using Bluetooth to transfer a video? 1 Ans. PAN (e) Tech Up Corporation (TUC) is a professional consultancy company. The company is planning to set up their new offices in Indian with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest to them the best available solutions. Their queries are mentioned as (i) to (iv) below. Physical Locations of the blocks of TUC Block to Block distances (in Mtrs.) Block (From) Block (To) Distance Human Resources Conference 60 Human Resources Finance 120 Conference Finance 60 Expected Number of Computers to be installed in each block Block Computers Human Resources 125 Finance 25 Conference 60 4 (i) What will the most appropriate block, where TUC should plan to install their server? 1 Ans. Human Resources will the most appropriate block, where TUC should plan to install their server. (ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication. 1 Ans. (iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bangalore with its London base office? • Infrared 1 14 cbsecsnip.in
  • 15. • Satellite Link • Ethernet Cable Ans. Ethernet Cable (iv) Which of the following devices will be suggested by you to connect each computer in each of the buildings? • Gateway • Switch • Modem 1 Ans. Switch (f) Write names of any two popular Open Source Software, which are used as Operating Systems. 1 Ans. Linux OpenSolaris (g) Write any two important characteristics of cloud computing. 1 Ans. Reduction of costs – unlike on-site hosting the price of deploying applications in the cloud can be less due to lower hardware costs from more effective use of physical resources. Choice of applications – This allows flexibility for cloud users to experiment and choose the best option for their needs. Cloud computing also allows a business to use, access and pay only for what they use, with a fast implementation time. 15 cbsecsnip.in