New ! Computer Science MCQ Practise Tests



12th Standard Computer Science English Medium Importing C++ Programs in Python Reduced Syllabus Important Questions 2021

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 100

      Multiple Choice Questions


    15 x 1 = 15
  1. C++ code is 5 to 10 times more than

    (a)

    Java

    (b)

    Python

    (c)

    C

    (d)

    Java script

  2. Which of the following python interface used for both C and C++?

    (a)

    MinGW

    (b)

    Ctypes

    (c)

    Cython

    (d)

    SWIG

  3. MinGW expansion is

    (a)

    Minimalist Graphics for windows

    (b)

    Minimum GNU for windows

    (c)

    Minimalist GNU for Windows

    (d)

    Motion Graphics for windows

  4. Which of the following is needed to run a c++ program on windows?

    (a)

    m++

    (b)

    g++

    (c)

    ghre++

    (d)

    f++

  5. In the command python <filename.py> -i <C++ filename> where i denotes.

    (a)

    Information

    (b)

    Input mode

    (c)

    ios

    (d)

    Interpreter

  6. Which of the following is not a python module?

    (a)

    OS

    (b)

    Sys

    (c)

    Tel

    (d)

    Getopt

  7. Which of the following is not a python module?

    (a)

    Sys

    (b)

    OS

    (c)

    Getopt

    (d)

    g++

  8. Which of the following definition invoke the 'g++' compiler and creates the exe file?

    (a)

    Main

    (b)

    Name

    (c)

    Run

    (d)

    System

  9. __________ is typically interpreted language.

    (a)

    Python

    (b)

    Java

    (c)

    C++

    (d)

    None of these

  10. ___________ refers to a set of runtime header files used in compiling and linking the C++ code to be run or window OS?

    (a)

    SWIG

    (b)

    MinGW

    (c)

    Cython

    (d)

    Boost

  11. __________ refers to the complete path where python is installed.

    (a)

    Relative path

    (b)

    Python path

    (c)

    Absolute path

    (d)

    Directory path

  12. __________ method returns value consisting of two elements.

    (a)

    sys.argv

    (b)

    oS.system ( )

    (c)

    getopt ( )

    (d)

    none of these

  13. _________ is one such special variable which by default stores the name of the file

    (a)

    - - name - -

    (b)

    - - main - -

    (c)

    - - getopt - -

    (d)

    - - sys - -

  14. _________ command of 'os' module executes the exe file to get the desired output.

    (a)

    Main ( )

    (b)

    Name ( )

    (c)

    Run ( )

    (d)

    System ( )

  15. The command to dear the window screen is __________.

    (a)

    CIs

    (b)

    Clear

    (c)

    Clr

    (d)

    Clrscr

    1. 2 Marks


    13 x 2 = 26
  16. What is the theoretical difference between Scripting language and other programming language?

  17. Differentiate compiler and interpreter.

  18. Differentiate static typed language and dynamic typed language.

  19. List some scripting language

  20. What is garbage collection in python?

  21. What is the use of GNU C complier?

  22. How will you execute C++ program through python using MinGW interface? Give example

  23. What does cd command refers?

  24. Write a note on
    (i) CD command
    (ii) CIs command

  25. What is meant by module?

  26. Write a note on main (sys.argv [1]).

  27. Write the syntax and example of
    (i) os.system ( ) 
    (ii) getopt ( )

  28. Write a command for wrapping C++ code.

    1. 3 Marks


    8 x 3 = 24
  29. Differentiate PYTHON and C++.

  30. What are the applications of scripting language?

  31. What is MinGW? What is its use?

  32. Identify the module, operator, definition name for the following
    welcome.display().

  33. What is sys.argv? What does it contain?

  34. Write a note on
    (i) sys module
    (ii) OS module
    (iii) getopt module

  35. How to import modules in python?

  36. Write an algorithm for executing C++ program pali_cpp.cpp using python program.pall.py.

    1. 5 Marks


    7 x 5 = 35
  37. Explain each word of the following command.
    Python  < filename.py > - < i > <C++ filename without cpp extension>

  38. Write a Python program to execute the following c++ coding.
    #include <iostream>
    using namespace std;
    int main()
    { cout<<“WELCOME”;
    return(0);
    }
    The above C++ program is saved in a file welcome.cpp

  39. Explain the commands for wrapping C++ code.

  40. Write a python program to execute the following C++ program.
    /*. To check whether the number is palindrome or not using while Ioop.*/
    // Now select File →New in Notepad and type the C++ program
    #include < iostream >
    using namespace std;
    intmain ( )
    {
    int n, num, digit, rev = 0;
    cout<<  "Enter a positive number: ";
    cin >>num;
    n= num;
    while(num)
    {digit = num % 10;
    rev = (rev * 10) + digit;
    num = num / 10; }
    cout<< "The reverse of the number is: " << rev <<endl;
    if(n == rev)
    cout< < "The number is a palindrome";
    else
    cout << "The number is not a palindrome";
    return 0;
    }
    // Save this file as pali_cpp.cpp

  41. Write a python program to execute the following C++ program.
    Transpose of a matrix(2 D array) C++ program:
    #include < iostream >
    using namespace std;
    int main ( )
    {
    int a[3][3], i, j;
    for(i=0; i< 3; i++)
    {
    for(j=0; j<3; j++)
    {cout<< "enter the value for
    array["<< i+ 1<< "]"<< " ["<< j+ 1<< "] :";
    cin >>a[i][j];
      }
    }
    system ("cIs");
    cout<< "\n\nOriginal Array\n";
    for(i=0; i<3; i++) {
    for(j=0; j<3; j++ )
    cout<< a[i][j]«' ';
    cout<< endl; }
    cout<< "\n\n The Transpose of Matrix\n";
    for (int i = 0; i < 3; i++)

      for (int j = 0; j < 3; j++)
    cout<< a[j][i]<< ' ';
    cout<< endl;

    return 0;
    }
    // Save this file as trans_cpp.cpp

  42. Write a python program to execute the following C++ program.
    C++ program:
    /*Write a C++ program using a user defined
    function to function cube of a number. */
    // Now select File⇾New in Notepad and type the C++ program
    #include
    using namespace std;
    // Function declaration
    int cube(int num),
    int main( )
    {
    int num;
    int c;
    cout<< "Enter any number: "<<endl;
    cin >>num;
    c = cube(num);
    cout<< "Cube of" << num<<  " is "<< c;
    return 0;
    }
    //Function to find cube of any number
    int cube(int num)
    {
    return (num * num * num);
    }
    // Save this file as cube_file.cpp

  43. Write a python program to execute the following C++ program
    To implement Multilevel Inheritance:
    // C++ program to implement Multilevel Inheritance
    // Now select File ⟶New in Notepad and type the C++ program
    c++ Program.
    #include < iostream >
    using namespace std;
    // base class
    class Vehicle
    {
    public:
    Vehicle ( )
    {
    cout<< "This is a Vehicle" << endl;
    }
    };
    class threeWheeler: public Vehicle
    { public:
    three Wheeler ( )
    {
    cout << "Objects with 3 wheels are vehicles" << endl;
      }
    };
    // sub class derived from two base classes
    class Auto: public threeWheeler{
    public: 
    Auto ( )

    cout<< "Auto has 3 Wheels"<< endl;
    };
    // main function
    int main ( )
    {
    //creating object of sub class will invoke the constructor of base classes
    Auto obj;
    return 0;
    }
    // Save this file as inheri_cpp.cpp

*****************************************

Reviews & Comments about 12th Standard Computer Science English Medium Importing C++ Programs in Python Reduced Syllabus Important Questions 2021

Write your Comment