CSC166 Object Oriented Programming

Object Oriented Programming TU Board 2080 (new course) question paper

12 questionsSit this paper (timed)

Tribhuvan University

Bachelor of Science in Computer Science and Information Technology

Semester 2 · TU Board 2080 (new course)

Course Title: Object Oriented Programming (CSC166)

Full Marks: 60Pass Marks: 24Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.

Group A

Attempt any TWO question.(2 × 10 = 20)

  1. 1.

    What is destructor? List its characteristics. Explain the use of default copy constructor with an appropriate example.

    10
  2. 2.

    Write a program to create a class named height with data members meter(int) and centimeter(int). Overload the binary + operator using friend function to add two heights.

    10
  3. 3.

    [figure in the original paper]

    Write a program to realize the above hierarchy. Create necessary member functions (constructor) to initialize and diaplay necessary information.

    10

Group B

Attempt any EIGHT question.(8 × 5 = 40)

  1. 4.

    Define object. What are the benefits of Object Oriented Programming Language?

    5
  2. 5.

    Explain the significance of type conversion. How do we achieve dynamic memory allocation in C++? Explain with an example.

    5
  3. 6.

    What is the benefit of passing object as arguments? Write a program to create a class named actor with data members name and rating. Initialize the data members and display those names whose rating is greater than 5 using the concept of constant object.

    5
  4. 7.

    Create two classesRupee and Dollar respectively. Write conversion operator to convert between Rupee and Dollar assuming that 1 dollar equals 133 rupees. Write a main program that allows the user to enter an amount in either currncy and then converts it to other currency and displays the result.

    5
  5. 8.

    Explain the practical implication of protected specifier in inheritance. list advantages and disadvantages of inheritance.

    5
  6. 9.

    Difference between compile time and run time polymorphism.

    5
  7. 10.

    Explain function template overloading with suitable example.

    5
  8. 11.

    Write a program that stores information of employees in a file and displays the file's content in ascending order of their salary.

    5
  9. 12.

    Write short notes on :

    1. This pointer
    2. ios member function
    5

— The End —