Preview only show first 10 pages with watermark. For full document please download

Final Class Xi Cs 083

MM: 70 No 1 FLORETS INTERNATIONAL SCHOOL, PANKI, KANPUR Computer Science (083)- CLASS XI Questions Time: 3Hrs. Marks a. Distinguish between (give example): (i) (ii) b. Convert : Formal parameter, Actual parameter, Value Parameter & Variable parameter. Defining a variable & Declaring a variable. (i) 4A7C16 to Binary (ii) C2F16 to octal 2+2 1+1 2 a. Evaluate the following, where a, b, c are integers and d, f are floating point numbers. The value of a=8, b=4 and d=2.5 (i) f = a * b + a/b (ii) c

   EMBED


Share

Transcript

  FLORETS INTERNATIONAL SCHOOL, PANKI, KANPURMM: 70 Computer Science (083)- CLASS XI Time: 3Hrs.No   Questions   Marks   1a. Distinguish between (give example):(i)   Formal parameter, Actual parameter, Value Parameter & Variable parameter.(ii)   Defining a variable & Declaring a variable. 2+2 b. Convert : (i) 4A7C 16 to Binary  (ii) C2F 16 to octal   1+1 2a. Evaluate the following, where a, b, c are integers and d, f are floating point numbers. Thevalue of a=8, b=4 and d=2.5(i)   f = a * b + a/b (ii) c = d   +   a + b % a 2   b. What will be the size of following constants? ‘ \ v’,   “ \ v”   1   c. Write the corresponding C++ expressions for the following mathematical expressions:i) √       (ii)    2 3.a. What do you understand by the terms Encapsulation, polymorphism, Abstraction? 3 b. What is the difference between Global Variable and Actual Variable? Give an example in C++to illustrate both.2 c. What is difference between ‘a’ and “a” in C++? 1 d. Name header file, to which following functions belong: isalpha(), gotoxy(), strlen( ), getc()   2 4. Give the output of following programs (assuming all required header files are included) a. int bug (int x)    { return x++; }   int error(int y)    { return ++y; }   void main(void)    { int val=50;val = bug(error(val *=val/val));   cout << val= <<val<<endl; }   b. void T(int &a, int &b, int c)    { cout <<a <<' '<<b<<' '<<c<<endl;   a=b+c; b+=a+c;   cout <<a <<' '<<b<<' '<<c<<endl; }   void main(void)    { int x = 5;T(x,x,x++);cout <<x <<endl; }   3+4  c. void X(int & A, int B )    { A = A + B; B = A  –  B; A = A  –  B; }   void main ( ) { int a = 4, b = 18; X(a,b); cout << a << ’,’ << b <<end1; }   d. void main()    { cout<< 14%3<<endl;cout<< -14%3<<endl;cout<< 14%-3<<endl; }int val =2;   2+3 e. divide(int a)    { return (a++ * val); }   void main(void)    { int val = 16;val = divide(val= val/4);   cout << \nval <<val<<endl; }   f. void main ( ) { int x = 5, y = 5;cout << x++ ; cout << ’  \  t’ ;   cout << --x ; cout << ’  \  t’ ;   cout << y++ << ’  \  t’ << --y << ’  \  n’; }   2+2 g. int a = -10;   int go(int &y)    { a = a+1; return (a * y++); }   void main(void)    { int a = 5,c1;c1 = go (go (a));cout << '\n'<<c1<<endl; }   Also give the output if we replace  c1 = go (go (a)); with c1 = go(a) + go(a)    h. void Encrypt(char T[]) { for (int i=0;T[i]!='\0';i+=2) if (T[i]=='A' || T[i]=='E') T[i]='#';else if (islower(T[i])) T[i]=toupper(T[ielse T[i]='@'; }void main() { char Text[]= SaVE EArtH ;   //The two words in the string Text //are separated by single space Encrypt(Text);cout<<Text<<endl; }   4+3 5.a. Find syntax error(s), if any, in the following program: include <iostream.h> void main ( ) ;{ int x ; cin << x ;for ( int y=0 ; y<x ; y++){ int z = y ;} cout << z <<endl ;} 3 b. Let S is a compound statement, & E1, E2, E3 are expressions then what is the differencebetween the given two program fragments a) & b) a). for(E1; E2; E3) S;b). E1; while (E2){ S; E3; }   2  6. Consider the following program & answer the following questions: void strfunc(char str[]){ int i, j, len = strlen(str) ;for(i=0; i<len; i++){ for(j=0; j<=i; j++)cout <<str[j];cout <<endl;}}void main(void) { strfunc(“Delhi”) ; }   a. Name header files required to execute the given program correctly. 2 b. Give the output of the given program. 2 c. Re-write user-defined function strfunc without using built-in function strlen : 3 7.a. Write a C++ function newpower(X,Y) to replaces the built-in function  pow(X,Y) . Also writethe main () function that gets values of X & Y from the user, to test this newpower   function.4 b. WAP to enter a +ve integer & create a new number by arranging the digits of srcinalnumber in ascending order and then display both numbers along with their difference. HINT: Store the digits in an array & sort it. Passthe array to a separate function for sorting. Fore.g:INPUT: 31498OUTPUT: Number entered = 31498New number is = 13489Difference = 18009  4 c. Write a function MERGE () to receive & merge the contents of 2 sorted arrays A[5] & B[7]into 3 rd array C[12]. Assuming array A Is sorted in ascending order, B is sorted indescending order, the resultant Array C is required to be in ascending order.4 d. Rewrite the given segment using nested if statement: int a,e,s;   cin>>a >>e;   s = (e==1)? (a>28 && a<35) ? 480:(a>35)? 600: 300: (e==0)? 200: 0;   cout<< s<<endl;  4