Computer Science Test 1 ,Sacred Heart Cmi Public School

6 Questions | Total Attempts: 34

SettingsSettingsSettings
Please wait...
Computer Science Test 1 ,Sacred Heart Cmi Public School

Output questions pattern1


Questions and Answers
  • 1. 
    Choose the related library function name based upon the given information in C++.      To check whether given character is either alphabet or numeric character or not.
    • A. 

      Toalpha()

    • B. 

      Isalpha()

    • C. 

      Isalnum()

    • D. 

      Isalphanum()

  • 2. 
    Reusability of classes is one of the major properties of OOP. How is it implemented in C++
    • A. 

      Polymorphism

    • B. 

      Modularity

    • C. 

      Inheritance

    • D. 

      Constructors

  • 3. 
    Predict the output #include #include                  void Secret(char Str[ ])                         {          for (int L=0;Str[L]!='\0';L++) for (int C=0;C<L/2;C++)             if (Str[C]=='A' || Str[C]=='E')                         Str[C]=Str[L-C-1];             else             {          char Temp=Str[C];                         Str[C]=Str[L-C-1];                         Str[L-C-1]=Temp;          }  }                                                                                          void main() {     clrscr(); char Message[ ]="CBSE2020"; Secret(Message); cout<<Message<<endl;
    • A. 

      22cBS00

    • B. 

      CC2300

    • C. 

      CB20SE20

    • D. 

      22SCB200

  • 4. 
     Suggest one situation where ambiguity arises in multi level inheritance A->B->C?   
    • A. 

      When A,B.C  have same constructor

    • B. 

      When A and B classes are not having public members

    • C. 

      When functions of A and B are having the  same name

    • D. 

      When C and A are  inherted

    • E. 

      None of the above

  • 5. 
    The following code is from a game, which generates a set of 4 random numbers. Yallav is playing this game, help him to identify the correct option(s) out of the four choices given below as the possible set of such numbers generated from the program code so that he wins the game. Justify your answer. 2 #include #include const int LOW=15; void main ( ) { randomize( ) ; int POINT=5, Number; for (int I=1;I<=4;I++) { Number=LOW+random(POINT) ; cout<
    • A. 

      19:16:15:18:

    • B. 

      14:18:15:16:

    • C. 

      19:16:15:16:

    • D. 

      19:16:14:18:

  • 6. 
    Evaluate the following postfix expression.                                             2,13, +, 5, -,6,3,/,5,*, /
    • A. 

      0

    • B. 

      10

    • C. 

      1

    • D. 

      20

Back to Top Back to top