You are on page 1of 7

DELHI PUBLIC SCHOOL GHAZIABAD

Annual Examination
Computer Science
(CLASS- XI)
(SET-A)
SESSION 2018-19

TIME 3 Hrs.
M.M. 70
Note: Attempt all questions: Answer question 2-7 with respect to C++ programming
language.

Q1 Answer the following: (10)


a. Differentiate between Analog and Digital Computer. 1
b. Categorize the following printers into impact and non impact. 1
i. Daisy-Wheel Printer ii. Dot Matrix Printer
iii. Laser printer iv. Ink Jet printer.
c. Define the term ASCII and ISCII. 1
d. List any 4 major functions performed by an Operating System. 2
e. Categorize the following into hardware and software. 2
1. Capacitor 2. Internet Explorer 3. UNIX 4. Hard Disc
f. Answer the following 3
i. Define Multiprocessing OS.
ii. What is cold booting and warm booting
iii. Define and give example of Utility Software.
Q2. Explain the following term: (6)
i) Variable ii) Token iii) Array iv) Debugging 6
v) Comment vi) Keyword
Q3. Give differences between the following terms with the help of suitable examples. (8)
a. 1. Parameter and argument 2
2. Syntax error and logical error
b. What are data types ? List all the predefined or fundamental data types in c++ ? 2
c. What will be the size of the given constants? 'x', "x", 1
d. Write the corresponding C++ statements for the following mathematical expressions: 1
i) √ (a2+b2)
(ii) (a+b)/(p+q)
e. Evaluate the following, where p, q are integers and r, f is floating point number 2
variable.The value of p=8, q=4
1. f = p* q + p/q
2. p+q+p%q
Q4. Answer the following (12)
a. Observe the following C++ code carefully and Write the output that will appear on 2
the screen after execution of it.
Important Note:- All the desired header files are already included in the code, which
are required to run the code.
void main()
{
char *Text=”PUNEETA”;
int *P, Num[]={1,3,5,7};
P=Num;
cout<<*P<<Text<<endl; Text++; P++;
cout<<*P<<Text<<endl; }
b. Based on the following C++ code find out the expected correct output(s) from the 2
option (i) to(iv). Also, find out the minimum and the maximum value that can be
Page 1 of 7
assigned to the variable Guess used in the code at the time when value of Turn is 3.
void main()
{
char Result[][10]={"GOLD","SILVER","BRONZE"};
int Getit=9,Guess;
for(int Turn=1;Turn<4;Turn++)
{ Guess=random(Turn);
cout<<Getit-Guess<<Result[Guess]<<"*"; } }

(i) 9GOLD*9GOLD*8SILVER* (ii) 9GOLD*7BRONZE*8GOLD*


(iii) 9GOLD*8SILVER*9GOLD* (iv) 9GOLD*8SILVER*8GOLD*
C. Observe the following C++ code carefully and write the output that will appear on the 3
screen after execution of it.
#include <iostream.h>
void Changethecontent(int Arr[], int Count)
{
for (int C=1;C<Count;C++)
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] <<’#’; }

d. An array P[20][30] is stored in the memory along the column with each of the 3
element occupying 4 bytes, find out the memory location for the element P[5][15], if
an element P[2][20] is stored at the memory location 5000.
e. What is the difference between call by value and call by reference? Also, give a 2
suitable C++ code to illustrate both.
Q5 Answer the following after reading the instructions carefully. (12)
a. Rewrite the following program after removing the syntactical errors (if any). 2
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;
ShowPoint(Point1);
Pixels Point2=Point1;
Color.Point1 += 2;
ShowPoint(Point2); }

b. b) Convert the following code segment into switch case construct. 3


int ch;
cin>>ch;
if(ch = = 1)
{ cout<<" Laptop";
else if(ch -

Page 2 of 7
cout<<"Desktop •
} else if(ch= = 3)
cout<<"Notebook";
} else cout<<"lnvalid Choice"; }
c. Convert the following code segment into do-while loop. 2
#include<iostream. h>
void main()
{ int i;
for(i= 1 ;i<=20;++i)
cout<<"\n"<<i; }
d. Given the following code fragment 2
int ch=5;
cout << ++ch<< "\n"<<ch<<"\n";

i) What output does the above code fragment produce?


ii) What is the effect of replacing ++ ch with ch + l?
e. Give two differences between entry controlled and exit controlled loops. Give an 3
example of each type..
Q6 Answer the following (6)
.a. Write the name of header file for the following functions. 2
i. isupper() ii) gets() iii. random() iv. sqrt()
b. Evaluate the following 4
i. (12)10 -> (X)2
ii. (A2B0)16 -> (X)8 –> (X)2
iii. (10110010)2 -> (X)2

Q7 Programming in C++ (16)


.a. Write a function CHANGEO in C++, which accepts an array of integer and its size as 3
parameters and divide and replaces all those array elements in the same array by 7
which are divisible by 7 and multiply other array elements by 3.
b Write a a function in C++ chkPrime(int) to check if a number is prime or not. The 3
function should return 1 if the number is prime and 0 if it is non prime.
c. Define a class in C++ with following description: 3
Private Members
A data member Flight number of type integer
A data member Destination of type string
A data member Distance of type float
A data member Fuel of type float
A member function CALFUEL() to calculate the value of Fuel as per the following
criteria
Distance Fuel
<=1000 500
More than 1000 and <=2000 1100
More than 2000 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
A function SHOWINFO() to allow user to view the content of all the data Members
d. Write a program to create a structure of employee with the data members Employee 3
Number(int), EmployeeName, salary(float).Accept the details of 10 employees in an
array of structure and display them.
e. Write a program to print a string (accepted from the user) in reverse order.(without 2
using library function).
f. Write a program to print Fibonacci series up to the term n(accepted from the user ). 2
Page 3 of 7
DELHI PUBLIC SCHOOL GHAZIABAD
Annual Examination
Computer Science
(CLASS- XI)
(SET-B)
SESSION 2018-19

TIME 3 Hrs.

M.M. 70
Note: Attempt all thequestions. Answer question 2-7 with respect to C++ programming
language.

Q1 (1
a. Define Mini computers and Micro Computers 2
b. Define system software. What are its two main types Give examples. 2
c. Differentiate between ASCII and UNICODE. 2
d. Differentiate between Compiler and Interpreter. List any two languages using each. 2
e. Convert -22 in 8 bit sign magnitude. 1
f. What do you understand by Spooling (with reference to function of Operating System. 1

Q2 Explain the following term: 6


.a. i) Keywords
ii) Literals
iii) Derived data types
iv) Identifiers
v) Comment
vi) Escape sequences

Q3 Answer the following. (8


.
a. Give differences between the following terms with the help of suitable examples. 2
i. Implicit type casting explicit type casting
ii. Procedural language and OOPs

b. What do you understand by comments in C++? Give the symbols used for the two types of comments 2
in C++.

c. What will be the size(in bytes) of the constants? 'a', "a", 1


d. Write the corresponding C++ expressions for the following mathematical expressions: 1
i) √ (p (a + b))
(ii) (x + y) / (z + x)

e. Evaluate the following, where p, q are integers and r, f are floating point numbers. 2
The value of p= 6 , q=4 and r=2.5
i. f = p / q * 3
ii. p + q + r * 5
Q4 Answer the following: (1
.

Page 4 of 7
a. Observe the following C++ code carefully and write the output, which will appear on the screen after 2
execution of it. Important Note: - All the desired header files are already included in the code,
which are required to run the code.
void main()
{
char *String —"SARGAM" ;
int*Ptr, A[ ] = {l,5,7,9};
Ptr = A ;
cout<<*Ptr <<String <<endl;
String++ ;
Ptr += 3 ;
cout<<*Ptr<<String<<endl;
}
b. Based on the following C++ code find out the expected correct output(s) from the option (i) to(iv). 2
Also, find out the minimum and the maximum value that can be assigned to the variable Chance.
#include<iostream.h>
#include<stdlib.h>
void main( )
{
randomize( );
int Arr[]={9,6},N;
int Chance=random(2) + 10;
for (int C=0; C<2 ; C++)
{
N=random(2);
cout<<Arr[N] + Chance<<”#”;
}
}
(i) 9#6# (ii) 19#17# (iii) 19#16# (iv) 20#16#
C. Write the output of the following code snippet. 3
#inc1ude <iostream.h>
struct POINT
{
int X, Y, Z;
};
void StepIn(POINT & P, int Step=1)
{
P.X += Step;
P.Y -= Step;
P.Z += Step;
}
void StepOut(POINT & P, int Step=1)
{ P.X -= Step;
P.Y += Step;
P.Z –= Step;
}
void main ( )

Page 5 of 7
{
POINT P1={15, 25, 5}, P2={10, 30, 20};
StepIn(P1);
StepOut(P2,4);
cout<<P1.X<<“,”<<P1.Y<<“,”<<P1.Z<<endl;
cout<<P2.X<<“,”<<P2.Y<<“,”<<P2.Z<<endl;
StepIn(P2,12);
cout<<P2.X<<“,”<<P2.Y<<“,”<<P2.Z<<endl;
}

d. An array P[50] [60] is stored in the memory along the column with each of the element occupying 2 3
bytes, find out the memory location for the element P[10][20], if the Base Address of the array is
6800.
e. What do you understand by Function overloading or Functional polymorphism? Explain with the 2
help of suitable example.
Q5 Answer the following: (1
a. Rewrite the following program after removing the syntactical errors (if any). 2
##Define float MaxSpeed=60.5;
void main()
{
int MySpeed
char Alert='N' ;
cin»MySpeed;
if MySpeed>MaxSpeed
Alert='Y' ; cout<<Alert<<endline; }

b. b) Convert the following code segment into switch case construct. 3


char ch;
if(ch==’a’)
cout<<”A for Aeroplane “;
else
if(ch==’e’)
cout<<”E for Elephant “;
if(ch==’I’)
cout<<”I for Igloo “;
else
cout<<” Invalid character”;

c. Convert the following code segment into for loop. 2


#include<iostream.h>
void main()
{ int i=10;
while(i < 20)
{

cout<<"\n"<<i;
i +=2;

Page 6 of 7
} }
d. What do you understand by unary operator. Give example and explain any 2 unary operator in C++. 2

e. Give two differences between entry controlled and exit controlled loops. Give an example of each 3
type.
Q6 Answer the following: (6
.a. Write the name of header file for the following functions. 2
i. setw() ii) strcmpi() iii. clrscr() iv. cos()
b. Evaluate the following 4
i. (18)10 -> (X)2
ii. (B2C0)16 -> (X)8 –> (X)2
iii. (11110010)2 -> (X)10
Q7 Programming Section (1
.a. Write the definition of a function Change(int P[], int N) in C++,which should replace all the 3
multiples of 10 in the array to 10 and rest of the elements as 1.
b Write a function chkNum(int) in C++ to check if a number is ARMSTRONG or not . The function 3
should return 1 if the number is Armstrong number and 0 if it is not an armstrong number.
NOTE: A positive integer is called an Armstrong number if the sum of cubes of individual digit is
equal to that number itself. For example: 153 is Armstrong Number.
153 = 1 * 1 * 1 + 5 * 5 * 5 + 3 * 3 * 3

c. Write the definition of a class Photo in C++ with following description: 3


Private Members
Pno //Data member for Photo Number(an integer)
Category //Data member for Photo Category(a string)
Exhibit //Data member for Exhibition Gallery(a string)
FixExhibit() //A member function to assign Exhibition Gallery as per Category as shown in the
//following table
Category Exhibit
Antique Zaveri
Modern Johnsen
Classic Terenida
Public Members
Register()// A function to allow user to enter Values Pno,Category and call FixExhibit() function
ViewAll() //A function to display all the data members
d. Write a program to create a structure of employee with the data members Employee Number(int), 3
EmployeeName, salary(float).Accept the details of 10 employees in an array of structure and display
them.
e. Write a program to check if a number is Palindrome or not.( without using library functions ) 2
f. Write a program to print multiplication table of a number up to the range. 2
Note both number and the range has to be inputted from the user.

Page 7 of 7

You might also like