Institute of Science and Technology
Bachelor Level/second semester/Science
Computer science and information Technology
(C ORIENTED PROGRAMMING )
Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.
1 Write a program according to the specification given below:
*create a class Teacher with data members tid & subject and ember functions tor reading and displaying data members.
*create another class Staff with data members sid &position, and member function for reading and displaying data members.
*Derive a class Coordinator from teacher and staff and the class must have its own data member department and member functions for reading and displaying data members
*Create two object of Coordinator class and read and display their details.
2. Explain the concept of operator overloading? List the operators that cannot be overloaded. Write programs to add two object of distance class with data members feet and inch by using member function and friend function.
3. Explain types of polymorphism briefly. Write d roles of polymorphism. How can wo achieve dynamic polymorphism briefly. write down roles or polymorphism. How can we achieve dynamic polymorphism Explain with example
Short Answer Questions
Attempt any 8 questions-(8×5 = 40)
4. How object oriented programming differs from object based programming language ? Discuss benefits of OOP
5. what is the use or new and delete operator illustrate with example. What are advantages or new malloc
6. What is meant by return by reference? How can we return values by reference by using reference variable? illustrate with examples.
7. What is destructor ? Write a program to show the destructor call such that it prints the message “Memmory” is released”.
8. What is this pointer? How can we use it for name conflict resolution? Illustrate with example.
9. How can you define catch statement that can catch any type of exception? lustrate the use of multiple catch statement with example.
10. Which functions can be used tor reading and writing object? Describe briefly. Write a program that read values of two objects of students class ( assume data members are sid ,snane , and level ) and display the data in monitor
11 write short notes:
*Cascading of IO operators
- Pure Virtual Functions