New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Classes and objects Book Back 3 Mark Questions with Solution

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 15

    3 Marks

    5 x 3 = 15
  1. Rewrite the following program after removing the syntax errors if any and underline the errors:
    #include
    $include
    class mystud
    { int studid =1001;
    char name[20];
    public
    mystud( ) { }
    void register ( )
    {cin>>stdid; gets(name); }
    void display ( )
    {cout<<studid<<”: “<<name<<endl;}
    }
    int main( )
    { mystud MS;
    register.MS( );
    MS.display( );
    }

  2. Write with example how will you dynamically initialize objects?

  3. What are advantages of declaring constructors and destructor under public accessability?

  4. Given the following C++ code, answer the questions (i) & (ii).
    class TestMeOut
    {
    public:
    ~TestMeOut() //Function 1
    {cout<<“Leaving the exam hall”<<endl;}
    TestMeOut() //Function 2
    {cout<<“Appearing for exam”<<endl;}
    void MyWork() //Function 3
    {cout<<“Answering”<<endl;} };
    (i) In Object Oriented Programming, what is Function 1 referred as and when doesit get invoked / called ?
    (ii) In Object Oriented Programming, what is Function 2 referred as and when doesit get invoked / called ?

  5. Write the output of the following C++ program code :
    #include
    using namespace std;
    class Calci
    {
    char Grade;
    int Bonus;
    public:
    Calci() {Grade='E'; Bonus=0;} //ascii value of A=65
    void Down(int G)
    {
    Grade-=G;
    }
    void Up(int G)
    {
    Grade+=G;
    Bonus++;
    }
    void Show()
    {
    cout<< Grade << "#" << Bonus << endl; }
    };
    int main()
    {
    Calci c;
    c.Down(3);
    c.Show();
    c.Up(7);
    c.Show();
    c.Down(2);
    c.Show( );
    return 0;
    }

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

Reviews & Comments about 11th Standard English Medium Computer Science Subject Classes and objects Book Back 3 Mark Questions with Solution

Write your Comment