Professional Documents
Culture Documents
11 Annual QP Set A and B Computer Science 2018
11 Annual QP Set A and B Computer Science 2018
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.
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); }
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";
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
b. What do you understand by comments in C++? Give the symbols used for the two types of comments 2
in C++.
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; }
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
Page 7 of 7