CBSE Class 11 Computer Science Sample Paper-02
CBSE Class 11 Computer Science Sample Paper-02
CBSE Class 11 Computer Science Sample Paper-02
A) Token: The smallest individual unit in a program is known as a token (Lexical Unit). There are 5 types of tokens. (i) Keywords (ii) Identifiers (iii) Literals (iv) Punctuators (v) Operators d. what is relation between Microprocessor and Microcomputer 2 Ans. Microcomputer is a computer that contain a Microprocessor e. Briefly Distinguish between a general purpose and special purpose computer 2 Q.No.2 a. what is the shortcut menu ? what is its significance b. what is the significance of Recycle Bin c. Explain the concept of time sharing d. What is meant by the term multiprogramming and multitasking e .Explain briefly the function performed by an operating system as processor manager. 2 2 2 2. 2
129
Q.No.3 a. 4.Differentiate between object oriented programming and procedural oriented programming with the help of examples of each. 3 A. Procedure Oriented Programming: A program in a procedural language is a list of instructions where each statement tells the computer to do something. The focus is on the processing. There is no much security for the data. Object Oriented Programming: The object oriented approach views a problem in terms of objects involved rather than procedure for doing it. In object oriented programming, object represents an entity that can store data and has its interface through functions b.Distinguish between if and switch statement. A)The if-else and switch both are selection statements and they both let you select an alternative out of given many alternatives by testing an expression. But there are some differences in their operations. (i) The switch statement differs from the if statement in that switch can only test for equality whereas if can evaluate a relational or logical expression. Ie multiple conditions. (ii) The switch statement selects its branches by testing the value of same variable whereas the if else construction lets you use a series of expressions that may involve unrelated variables and complex expressions. (iii) The if-else can handle ranges whereas switch cannot. c.Differentiate between call by value and call by reference with help of an example. A)(i)In call by value, actual arguments will be copied into the formal perameters. In call by reference, formal perameters are references to the actual arguments. (ii)In call by value, if any modification is occurred to the formal perameter, that change will not reflect back to the actual argument. In call by reference, if any modification is occurred to the formal perameter (reference to the actual argument), the actual argument value will be changed. (iii) We should go for call by value when we dont want to modify the original value. We should go for call by value when we want to modify the original value. (iv) Example: void Change(int a, int &b) { a= 2*a; b=20; } Here a is called by call by value method and b is called by call by reference So as the value of a is changed, actual argument for a will not be changed, as the value of b is changed, actual argument for b will be changed d.Write the names of the header files of the following functions. i)getch() ii) isalpha() iii)strcpy() iv)sqrt() A) (i) getch( ) - conio.h (ii)isalpha( ) ctype.h (iii)strcpy( ) - string.h (iv)sqrt( ) - math.h Q.No.4 a. What will be the output of the following program? 3 2 4 3
130
int main() { int i=0,x=0; for(i=1;i<10;i*=2) { x++; cout<<x; } cout<<\n<<x; } b.Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. #include<iostream.h> int main { struct movie { char movie_name[20]; char movie_type; int ticket_cost=100; }movie; gets(movie_name); gets(movie_type); } A) #include<iostream.h> #include<stdio.h> void main( ) { struct movie { char movie_name[20]; char movie_type; int ticket_cost; }Movie; Movie.ticket_cost=100; gets(Movie.movie_name); cin>>Movie.movie_type; } c. Define the terms Polymorphism & Inheritance. d.Write the output of the following program. #include <iostream.h> void main() { int x = 5; if(x++ = = 5) cout<<five<<endl; else 3 2 3
131
if(++x = = 6) cout<<Six<<endl; } e) What will be the output of the following segment? struct number { int no1, no2; }; void display(number n) { cout<<Number1=<<n.no1++<<Number2=<<- -n.no2<<endl; } void main( ) { number n1={10,100}, n2, n3; n3 = n1; n1.no1 + = 5; n2 = n3; n2.no1 - = 5; n2.no2 * = 2; n3.no1 + = 1; display(n1); display(n2); display(n3); } f. convert (4A8c)16 into binary number Q.No.5 a. Write a program to find the factorial of any given number 3 b. Assuming suitable data types give necessary declaration for an array of 20 voter records each record of which consists of four data values viz. id_no,name, address, age, make use of above declaration to write program segment that print id_no and name for all those whose age exceeds 60. 5 c. Write a program to add two matrices of same order MXN. 4 d. Write a program to find either given no is prime or not 3 e. Write a function to find simple interest 3 2 4
132