BIM (TU) Question Paper 2014 – Object Oriented Programming | 3rd SEM

Download our Android App from Google Play Store and start reading Reference Notes Offline.

object oriented programmingTribhuvan University
BIM / Third Semester / ITC 216: Object Oriented Programming
Year: 2071 (2014)

Full Marks: 40 | Time: 2 Hrs
Candidates are required to answer all the questions in their own words as far as practicable.

Group “A” – 1. Brief Answer Questions: [10 X 1 = 10]

i. Which value is assigned to create pure virtual function?
ii. In the given enum, what is the value of BLUE? => enum COLOR {WHITE, BLACK = 100, RED, BLUE, GREEN = 300};
iii. What does new return if there is insufficient memory to make your new object?
iv. In what order are constructors and destructors called when a derived-class object is created and deleted?
v. Which operators are used for dynamic allocation and de-allocation of memory for arrays.
vi. A friend function cannot be used to overload the assignment operator =. Explain, why?
vii. Write the different modes in which files can be opened in C++.
viii. Write any two ios member functions?
ix. What is an Abstract Base Class?
x. How does a class accomplish data hiding?

Group “B” – Short Answer Questions: [5 X 3 = 15]

2. What is stream in C++? Write a complete program to read and write data from 10 employees into file “Employee.Rec”. The employee data contains Employee name, code and age.
3. Write overloaded version of iquote(), a function that displays its argument. Write three versions: one for an int argument, one for a float argument, and one for a string argument. Show the calling of functions in main().
4. How do you handle the type conversion between two different user defined data type? Explain with example.
5. Illustrate with example how CRC Cards, class diagram, and object diagram are used in object oriented design.
6. What is the advantage of template? Support with example.

Group “C” – Long Questions: [3 X 5 = 15]

7. Why is it necessary to overload an operator? Design a Cricket Player that includes three integer fields: a player’s jersey number, number of runs, and number of wickets. Include input(), output() function to read the data and display it respectively. One Cricket Player is considered greater than another if the sum of runs plus wickets is greater. Create an array of 11 CricketPlayers, then use the > operator to find the player who has the greatest total of runs plus wickets.
8. What are the advantages of using abstract classes? Explain with example.
9. What is private constructor? Write a class with private constructor.

Posted By : MeroSpark | Comment RSS | Category : Bachelor Level, Tribhuvan University
Tag :

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*