KEMBAR78
Class Xii Computer Science (083) : General Instructions - (I) All Questions Are Compulsory (Ii) Programming Language: C++ | PDF | Array Data Structure | C (Programming Language)
0% found this document useful (0 votes)
131 views7 pages

Class Xii Computer Science (083) : General Instructions - (I) All Questions Are Compulsory (Ii) Programming Language: C++

This document contains questions from the Computer Science subject for Class XII. It includes questions on topics like functions, arrays, classes, inheritance, file handling, SQL, boolean algebra, computer networks and more. The questions range from short answer to code writing. For example, question 1(a) asks to differentiate between call-by-value and call-by-reference methods of function call. Question 5(c) asks to write a C++ function to read a binary file and display records with a percentage above 75.

Uploaded by

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

Class Xii Computer Science (083) : General Instructions - (I) All Questions Are Compulsory (Ii) Programming Language: C++

This document contains questions from the Computer Science subject for Class XII. It includes questions on topics like functions, arrays, classes, inheritance, file handling, SQL, boolean algebra, computer networks and more. The questions range from short answer to code writing. For example, question 1(a) asks to differentiate between call-by-value and call-by-reference methods of function call. Question 5(c) asks to write a C++ function to read a binary file and display records with a percentage above 75.

Uploaded by

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

1

CLASS XII COMPUTER SCIENCE(083)


TimeAllowed : 3 HrsMax Marks : 70

General Instructions- (i) All questions are compulsory


(ii) Programming Language: C++

1.

(a) Differentiate between call-by-value and call-by-reference methods of function call.


(b)Observe the following code and write the name(s) of the header files essentially required
to compile it.
void main()
{
double x=125.892145;
cout.setf(ios::fixed);
cout<<setprecision(2)<<x;
}
(c) Find out the syntax errors (if any) in the following program. (Assuming all the required
header files are included.)
#define rem (a,b)=a%b;
void main()
{
float x=10,y=3;
r=rem(x,y)
cout<<r;
}

2
1

(d) Find the output of the following program.


#include<iostream.h>
void main()
{
int x[]={0,1,2,3,4,5};
int *p=&x[5],*q=x;
while(*p)
{
*p+=*q;
p--;
q++;
}
for(int i=0;i<6;i++)
cout<<x[i]<<" ";
}
(e)Find the output of the following program.
#include <iostream.h>
#include<string.h>
#include<ctype.h>
void main()
{
char *S=ObjeCT;
int L=strlen(S);

2.

for(int C=0;C<L;C++)
if(islower(S[C]))
S[C]=toupper(S[C]);
else
if(C%2==0)
S*C+=E;
else
S[C]=tolower(S[C]);
cout<<New message :<<S;
}
(f) Observe the following program carefully and identify the correct option(s) out of the
four choices given below as the possible outputs.
#include <iostream.h>
#include <stdlib.h>
void main ( )
{
int high=20,Score;
randomize( ) ;
for (int I=1;I<=4;I++)
{
Score=high-random(I) ;
cout<<Score<<: ;
}
}
(i) 20:18:19:20:
(ii) 20:19:19:17:
(iii) 20:19:17:18:
(iv) 20:20:18:18:
(a) How do private and public visibility modes of inheritance differ?
(b) Answer the question (i) and (ii) after going through the following class
class test
{
int year; char type[3];
public:
test (int y )
// Function 1
{ year=y;}
test (test &t); // Function 2
};
i) In Object Oriented Programming, which concept is illustrated by Function 1 and
Function 2 together? Create an object, such that it invokes Constructor 1.
ii) Write complete definition for Constructor 2.
(c) Define a class TAXI in C++ with following description:
Private Members:
A data member Taxi-no of type String
A data member Destination of type string
A data member Distance of type float
A data member Fare of type float
A member function calcrate() to calculate the Fare as per the following criteria :

2
2

3
Distance
<=10 Km
more than 10 Km

Fare
Rs 200/Rs 15/- perkilometer

Public Members:
A function Enterdata() To input Taxi_no, Destination, Distance and to calculate Fare by
calling calcrate() function.
A function Showdata() to display the values of all the data members.
(d) Answer the questions (i) to (iv) based on the following:
4
class Animal
{
int leg:
protected:
int tail;
public:
void INPUT (int );
void OUT ( );
};
class wild : private Animal
{
intNon_veg;
protected:
int teeth;
Public:
void INDATA (int, int )
void OUTDATA( );
};
class pet : public Animal
{
int veg;
public:
void DISP (void);
};
(i) Name the type of inheritance shown by the above code.
(ii)Name the data member(s) that can be accessed from function DISP ( ).
(iii)Name the member function(s), which can be accessed from the objects of class pet.
(iv)Is the member function OUT( ) accessible by the objects of the class wild?
3.
(a) Define a function SwapArray( int [ ], int), that would accept a one dimensional
integer array NUMBERS and its number of elements N as parameters and rearrange the
array insuch a way that the values of alternate locations of the array are exchanged
(Assume the size of the array to be even)
Example :
If the array initially contains
{2, 5, 9, 14, 17, 8, 19, 16},
then after rearrangement the array should contain
{5, 2, 14, 9, 8, 17, 16, 19}
3
(b) An array AR[15][15] is stored in the memory with each element occupying 2 bytes of
space. Assuming the base address of AR to be 3000, compute the address of
AR[10][5], when the array is stored :
3
(i) Row Wise

4.

(ii) Column Wise


(c) Write a function in C++ to find the sum of diagonal elements from a 2 dimensional
array of type float. Use the array and its size as parameters with float as its returntype. 2
(d) Evaluate the following postfix notation of expression:
(Show status of Stack after each operation)
2
False, True, NOT, OR, True, False, AND, OR
(e) Define member functions queins( ) and quedel( ) of the following class to insert and delete
nodes for implementing a linked queue.
4
struct node
{
char name[20];
int age;
node *Link;
};
class queue
{
node * rear,* front;
public:
queue(){rear=NULL;front=NULL};
voidqueins();
voidquedel();
};
(a) Observe the program segment given below carefully, and answer the question that
follows:
1
class Book
{
int Book no;
charBook_name[20];
public:
//function to enter Book details
voidenterdetails();
// function to display Book details
voidshowdetails();
//function to return Book_no
intRbook_no (){return Book_no;}
};
void Modify(Book NEW)
{
fstream File;
File.open(BOOK.DAT,ios::binary|ios::in|ios::out);
Book OB;
intRecordsread = 0, Found = 0;
while (!Found &&File.read((char*)&OB, sizeof (OB)))
{
Recordsread ++ ;
if (NEW.RBook_no() = = OB.RBook_no))
{
______________ //Missing Statement
File.write((char*)&NEW, sizeof (NEW));
Found = 1;

5.

}
else
File.write((char*)&OB, sizeof(OB));
}
if (! Found)
cout<<" Record for modification does not exist;
File.close();
}
If the function Modify( ) is supposed to modify a record in file BOOK.DAT with the
values of Book NEW passed to its argument, write the appropriate statement for
missing Statement using seekp( ) or seekg( ), whichever needed, in the above code
that would write the modified record at its proper place.
(b) Write a function in C++ to count the number of lines beginning with A or a in a text file
"NOTES.TXT".
2
(c) Given a binary file STUDENT.DAT, containing records of the following classStudent
class Student
{
charS_Admno[10]; //Admission number of student
charS_Name[30]; //Name of student
int Percentage; //Marks Percentage of student
public:
voidEnterData()
{
gets(S_Admno);gets(S_Name);cin>>Percentage;
}
voidDisplayData()
{
cout<<S_Admno<< <<S_Name<< <<Percentage<<endl;
}
intReturnPercentage(){return Percentage;}
};
Write a function in C++, that would read contents of file STUDENT.DAT and display
the details of those Students whose Percentage is above 75.
(a)What do you understand by DDL and DML?
(b)Consider the following tables GAMES and PLAYER.
Table: GAMES
GCode
GameName
Number
PrizeMoney
ScheduleDate
101
Carom Board
2
5000
23-Jan-2013
102
Badminton
2
12000
12-Dec-2012
103
Table Tennis
4
8000
14-Feb-2013
105
Chess
2
9000
01-Jan-2013
108
Lawn Tennis
4
25000
19-Mar-2012
Table: PLAYER
PCode
Name
GCode
1
Nabi Ahmad
101
2
Ravi Sahai
108
3
Jatin
101
4
Nazneen
103
(b1) Write SQL commands for thestatements(i) to (iv)
(i) To display the name of all Games with their Gcodes

6
No of Computers in each Block
(ii) To
display details of those games which are
having PrizeMoney more than 7000.
(iii) To display the content of the GAMES table in ascending order of Schedule Date.
(iv) To display the no of players with each GCode from the table PLAYER.
(b2) Give outputs for the following SQL queries:
2
(i) SELECT GAMENAME,NAME FROM GAMES,PLAYER WHERE
GAMES.GCode=PLAYER.GCode;
(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM GAMES;
(iii) SELECT SUM(PrizeMoney) FROM GAMES;
(iv) SELECT DISTINCT Gcode FROM PLAYER;
6.

(a)State and verify Absorption Laws.


(b)Write the equivalent Boolean Expression for the following Logic Circuit

2
2

U
V

(c) Write the POS form of a Boolean function G, which is represented in a truth table as follows: 1
P
Q
R
G
0
0
0
0
0
0
1
0
0
1
0
1
0
1
1
0
1
0
0
1
1
0
1
0
1
1
0
1
1
1
1
1

(d)Reduce the following Boolean Expression using K-Map:


F(U,V,W,Z)=(0,1,2,4,5,6,8,10)

(a) State one advantage and disadvantage of star topology.


(b) What is VoIP?
(c) Site any two examples for IPR violations.
(d) When you fill a web based application, if you leave a mandatory field, you will get
error message. What type of script is generally used for such checks?
(e) ABC info systems is planning to network its office spread in four blocks:

1
1
1

BLOCK 2

BLOCK 1
BLOCK 4

BLOCK 3

7
Block
BLOCK 1
BLOCK 2
BLOCK 3
BLOCK 4

No of Computers
90
120
60
50

Distance between various blocks


BLOCK 1
BLOCK 2
40 M
BLOCK 3
BLOCK 1
150 M
BLOCK 1
BLOCK 4
40 M
BLOCK 2
BLOCK 3
30 M
BLOCK 4
BLOCK 2
70 M
BLOCK 3
BLOCK 4
80 M
(e1) Suggest suitable block for housing the server
(e2) Suggest the most suitable cable layout for connecting various blocks.
(e3) Suggest the placement of Switch/Repeater in the network.
(e4) The company wantsto ensure wireless internet access to the employees within its
compound. What technology they should adopt?
(f)Differentiate between Proprietary software and Open Source Software.
(g) What do you mean by Community cloud?
**********************************

1
1
1
1
1
1

You might also like