Computer Science (Theory) - Class Xii Sample Question Paper-II Subject Code - 083
Computer Science (Theory) - Class Xii Sample Question Paper-II Subject Code - 083
MM : 70
No.
Questions
Marks
1.
(a)
(b)
Write the names of the header files to which the following belong:
(i)
(c)
frexp()
(ii)
isalnum()
Rewrite the following program after removing the syntactical errors (if any).
Underline each correction.
#include <iostream.h>
struct Pixels
{
int Color,Style;}
void ShowPoint(Pixels P)
{
cout<<P.Color,P.Style<<endl;}
void main()
{
Pixels Point1=(5,3);
ShowPoint(Point1);
Pixels Point2=Point1;
Color.Point1+=2;
ShowPoint(Point2);
}
(d)
No.
Questions
Marks
Arr[C-1]+=Arr[C];
}
void main()
{
int A[]={3,4,5},B[]={10,20,30,40},C[]={900,1200};
Changethecontent(A,3);
Changethecontent(B,4);
Changethecontent(C,2);
for (int L=0;L<3;L++) cout<<A[L]<<'#';
cout<<endl;
for (L=0;L<4;L++) cout<<B[L] <<'#';
cout<<endl;
for (L=0;L<2;L++) cout<<C[L] <<'#';
}
(e)
No.
Questions
Marks
Game N=M;
N.Magic[0]='A';N.Magic[3]='J';
N.Score-=120;
cout<<N.Magic<<N.Score<<endl;
}
(f)
In the following program, if the value of N given by the user is 20, what
maximum and minimum values the program could possibly display?
#include <iostream.h>
#include <stdlib.h>
void main()
{
int N,Guessnum;
randomize();
cin>>N;
Guessnum=random(N-10)+10;
cout<<Guessnum<<endl;
}
2.
(a)
(b)
Answer the questions (i) and (ii) after going through the following program:
class Match
{
int Time;
public:
Match()
//Function 1
{
Time=0;
cout<<"Match commences"<<end1;
34
No.
Questions
Marks
}
void Details()
//Function 2
{
cout<<"Inter Section Basketball Match"<<end1;
}
Match(int Duration)
//Function 3
{
Time=Duration;
cout<<"Another Match begins now"<<end1;
}
Match(Match &M)
//Function 4
{
Time=M.Duration;
cout<<"Like Previous Match "<<end1;
}
};
(c)
i)
ii)
Fuel
<=1000
500
1100
35
No.
Questions
more than 2000
Marks
2200
Public Members
"
A function FEEDINFO() to allow user to enter values for Flight Number,
Destination, Distance & call function CALFUEL() to calculate the quantity of Fuel
"
(d)
A function SHOWINFO() to allow user to view the content of all the data members
No.
Questions
Marks
char Voucher_No[10];
char Sales_Date[8];
public:
SHOP();
void Sales_Entry();
void Sales_Detail();
};
(i)
Write the names of data members which are accessible from objects belonging to
class CUSTOMER.
(ii)
Write the names of all the member functions which are accessible from objects
belonging to class SALESMAN.
(iii)
Write the names of all the members which are accessible from member functions of
class SHOP.
(iv)
3.
(a)
(b)
An array P[20][30] is stored in the memory along the column with each of the
element occupying 4 bytes, find out the Base Address of the array, if an
element P[2][20] is stored at the memory location 5000.
(c)
(d)
Write a function in C++ to find sum of rows from a two dimensional array.
(e)
Observe the program segment given below carefully and fill the blanks marked
as Statement 1 and Statement 2 using seekg() and tellg() functions for
performing the required task.
#include <fstream.h>
class Employee
37
No.
Questions
Marks
{
int Eno;char Ename[20];
public:
//Function to count the total number of records
int Countrec();
};
int Item::Countrec()
{
fstream File;
File.open("EMP.DAT",ios::binary|ios::in);
______________________ //Statement 1
int Bytes =
______________________ //Statement 2
int Count = Bytes / sizeof(Item);
File.close();
return Count;
}
(b)
(c)
Write a function in C++ to count the number of alphabets present in a text file
"NOTES.TXT".
Write a function in C++ to add new objects at the bottom of a binary file
"STUDENT.DAT", assuming the binary file is containing the objects of the
following class.
class STUD
{
int Rno;
char Name[20];
public:
void Enter(){cin>>Rno;gets(Name);}
void Display(){cout<<Rno<<Name<<endl;}
};
38
No.
Questions
Marks
5.
(a)
Consider the following tables GAMES and PLAYER and answer (b) and (c) parts
of this question:
Table: GAMES
GCode
GameName
Type
Number
Prize
Money
Schedule
Date
101
Carom Board
Indoor
5000
23-Jan-2004
102
Badminton
Outdoor
12000
12-Dec-2003
103
Table Tennis
Indoor
8000
14-Feb-2004
105
Chess
Indoor
9000
01-Jan-2004
108
Lawn Tennis
Outdoor
25000
19-Mar-2004
Table: PLAYER
(b)
(c)
PCode
Name
Gcode
Nabi Ahmad
101
Ravi Sahai
108
Jatin
101
Nazneen
103
(ii)
To display details of those GAMES which are having PrizeMoney more than
7000.
(iii)
(iv)
(ii)
(ii)
No.
Questions
(iv)
Marks
6.
(a)
(b)
Write the equivalent Boolean Expression for the following Logic Circuit
(c)
(d)
F(U,V,W,Z)= (0,1,2,4,5,6,8,10)
7.
a)
b)
c)
d)
e)
Ravya Industries has set up its new center at Kaka Nagar for its office and
web based activities. The company compound has 4 buildings as shown in
the diagram below:
40
No.
Questions
Marks
50 m
60 m
25 m
170 m
125 m
90 m
15
Raj Building
150
Fazz Building
15
Jazz Bulding
25
e1)
e2)
Suggest the most suitable place (i.e. building) to house the server of this organisation
with a suitable reason.
e3)
(i)
(ii)
Switch
e4)
The organisation is planning to link its sale counter situated in various parts of the
same city, which type of network out of LAN, MAN or WAN will be formed? Justify
your answer.
f)
g)
How Trojan Horses are different from Worms? Mention any one difference.
41