You are on page 1of 6

SAMPLE QUESTION PAPER SET II COMPUTER SCIENCE (083) Class XI

Time : 3 hours
General Instructions:All the questions are compulsory The paper contain 7 Questions Programming language used: C++ S.NO. Q1. Sub Questions Part (a) Define Database Management System (DBMS). Name two database packages. (b) (c ) Name any 2 anti virus software Arrange the units of storage in descending order. TB, GB, PB,MB Give the Full form of ASCII C onvert the following:(1) (45.54)10 = (?)2 (2) (735)8 = (?)2 (3) (110100101111)2 = (?)10 (4) (A3F) 16 = (?)2 Differentiate between PS-2 port and serial port. Arrange in order:(i) Coding of the program (ii) Design the program (iii) Testing the program (iv) Analyze the problem (v) Understand the problem Differentiate between /**/ and // How many times the following loop will be executed:for( int i=0;i<20;i+=2) Identify the correct identifiers(any 2):(i). AS_G_D (ii) (iii) roll number (iv) (v) age123 (vi) 2wer S.I. rate 2 Marks 1

Maximum Marks : 70

1 1

(d) (e)

1X4

(f) Q2 (a)

(b) (c )

1 1

(d)

(e)

What is the purpose of Indentation? Indent the following

program: #include<iostream.h> void main() {int i=0; for (i=0;i<20;i++){ cout<<i; cout<<endl;} } (f) Ifelse is used instead of switch-case in certain program 2 segments, why? Explain giving examples. Identify the number of variables for input and output in the following case study:ABC bank wants to calculate Simple interest of a customer depending upon the principle value, rate of interest and time period. Note: - Simple Interest = (Principal * Rate * Time period) /100 Identify the data types for the following (i) a (ii) 0x234 Write an expression to find the greater of two variables x, y and store in z using conditional/ternary operators. Give the name of related header files (i) abs( ) (ii) atoi( ) (iii) setw ( ) (iv) isalpha ( ) What is the importance of main ( ) in a C++ program? How many bytes are required by the following (i) short int (ii)unsigned long (iii) long double (iv) signed char If we are having four variables named as a, b, c, d having values 4 ,7,12,4 respectively .Solve the related expression following (i) (a>b)&&(a= =d)||(c>d) (ii) (b<=a)&&(d>a)||(c=a) (iii) (True && ! False) || False What is typecasting? Give an appropriate example. What will be the output of following code segment: #include<iostream.h> #include<conio.h> void main() { int a,b; a=20; b=35; a++; cout<<a<<,; 2

(g)

Q3.

(a)

(b)

(c)

2 2 2

(d) (e)

(f)

1*3

(g) (h)

2 2

cout<<++a<<endl; cout<<b++ << ,; cout <<b; } Q4. (a) What will be the possible output of the following function void Rprint() { randomise( ); int x=random(3)+1; for(int i=0;i<=x;i++) cout<<i+2<<,; } (i) 0,1,2,3,4,,5 (ii) 1,2,3,4,5 (iii) 2,3,4,5 (iv) 2,3,4,5,6, 2

(b)

(c)

Convert following for loop into while loop:2 fact=1; sum=0; for(int i=1;i<10;i++) { for(int j=i;j>=1;j--) { fact=fact*j; } sum=sum+fact; fact=1; } Write a function to accept garment_code, cost of the garment as 3 input and calculate the bill amount after deducting DISCOUNT as per the following criteria: No. of Calls Amount Less than 500 no discount 501-2000 5% discount 2001-3000 10% discount 3001 and above 15% discount Find the output:(i) cout<< strcmp(computer,computer); (ii) cout<<isdigit(b); (iii) cout<<toupper(m); (iv) cout<<strlen(computer 123#5); (v) cout<<sqrt(pow(5, 2)); (vi) cout<<floor(7.8); 3

(d)

(e)

Write a user defined function Pattern_printing() which takes a 3 character and number of time to print as argument and print

triangle . Example Input Char - * No of times 5 Output * ** *** **** ***** Find the errors in the following code segment { int a[5.5 ]={1,7,8,9,10}; sum=0; for (i=0;i<5;i++) if(a[i]%2==0) sum +=a(i); else sum = - a[t]; cout>>sum=>>sum>>endl; } Consider the given code and answer question a to d 1 #include<iostream.h> 2 #include<conio.h> 3 void main() 4 { 5 int a,b; 6 cin>>a>>b; 7 int disp(int , int &); 8 cout<< disp(a,b); 9 } 10 int disp(int x, int &y) 11{ 12 int z=x+y; 13 return z; 14 } a. Identify the line number in which function prototype is given b. Identify the line number where the function disp() is called c. Identify the number and types of arguments d. What is the return type of the function disp()

Q5.

(a)

(b)

*4=2

(c)

Write a user defined function lsearch( ) which takes three 3 parameters an integer array, size of array and element to be search and function return position of the element if the element is found and 0 if not found

Q6.

(a)

Example:Array {2,4,8,11,23,45,67,78,90} Element to search 11 Function should return 4 Consider the following code: #define area(a) a*a void Aarea(int a) { return a*a; } void main ( ) { cout<<area(5+7); //Statement no 1 cout<<Aarea(5+7);// Statement no 2 } The output of Statement no 1 and Statement 2 will not be same. Give the output and the explanation. Write a user defined function in c++ which takes a string as parameter and it should also display total number of words in the string and return number of words starting with A. Note:- Assuming that each word is separated by a single space. Example:String: An Apple A Day Keeps A Doctor away Output:8 Function should return 4 Write a user defined function which takes one integer type 2-D array, no. of rows, no. of column as parameter and display product of the elements of each column Example: Array 1 2 4 7 2 3 1 0 3 5 6 9 Output Column no 1: 6 Column no 2:30 Column no 3:24 Column no 4:0

(b)

(c)

Q7.

(a)

What will be the output of the following code:struct Grocery { int I_no; char I_name[20]; float I_price; int I_qty;

*4=2

}; void main() { Grocery S[4]={{1,Bread,11.0,20}, {2, Butter,25.0,40}, {3,Cream,65,15}, {4,Jam,95.5,20}}; cout<<S[0].I_no; cout<<S[1].I_name[3]; cout<<S[2].I_qty; cout<<S[3].I_name; } (b) Declare a structure Student with the following elements: Rollno Name DOB Marks Average integer type string type date type An array of float type to store marks in 5 subjects float 4

Write following user defined function in c++ to implement the above structure : 1 A function Read_student() which takes a structure object as a reference parameter and accept values of Rollno, Name, DOB,Marks array 2. A function Calculate_Avg() which takes a structure object as a parameter and calculates the average marks of the student

You might also like