New ! Computer Science MCQ Practise Tests



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

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 25

    5 Marks

    5 x 5 = 25
  1. Explain nested class with example.

  2. Mention the differences between constructor and destructor.

  3. Define a class RESORT with the following description in C++ :
    Private members:
    Rno // Data member to store room number
    Name //Data member to store user name
    Charges //Data member to store per day charge
    Days //Data member to store the number of days
    Compute ( ) /* A function to calculate total amount as Days * Charges and if the total amount exceeds 11000 then total amount is 1.02 * Days *Charges */
    Public member:
    GetInfo( ) /* Function to Read the information like name, room no, charges and days */
    DispInfo ( ) /* Function to display all entered details and total amount calculated using COMPUTE function */

  4. Write the output of the following
    #include < iostream >
    #include < stdio.h >
    using namespace std;
    class sub
    {
    int day, subno;
    public :
    sub(int,int); // prototype
    void printsub()
    { cout << " subject number : " << subno;
    cout << " Days : " << day; }
    };
    sub::sub(int d=150,int sn=12)
    { cout << endl << "Constructing the object" << endl;
    day=d;
    sub no=sn;
    }
    class stud
    {
    int rno;
    float marks;
    public:
    stud( )
    { cout << "Constructing the object of students" << endl;
    rno=0;
    marks=0.0;
    }
    void getval()
    {
    cout << "Enter the roll number and the marks secured ";
    cin >> rno >> marks;
    }
    void printdet()
    { cout << "Roll no : " << rno << "Marks:" << marks << endl; }
    };
    class addmission {
    sub obj;
    stud objone;
    float fees;
    public :
    add mission ( )
    { cout<< "Constructing the object of admission " << endl;
    fees=0.0;
    }
    void printdet ( )
    { objone.printdet ( );
    obj.printsub( );
    cout << "fees :" << endl; }
    };
    int main ( )
    {system("cls");
    addmission adm;
    cout << endl << "Back in main( )";
    return 0; }

  5. Explain the different methods of creating an object in C++.

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

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

Write your Comment