LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034
|
B.Sc. DEGREE EXAMINATION – COMPUTER SCIENCE
THIRD SEMESTER – November 2008
CS 3502 – OBJECT ORIENTED PROGRAMMING WITH C++
Date : 06-11-08 Dept. No. Max. : 100 Marks
Time : 9:00 – 12:00
Part – A
Answer ALL the questions (10 x 2 = 20 marks)
- What is the use of a static data member?
- Define an object.
- What is meant by pure virtual functions?
- Write the syntax of template.
- What is meant by Inheritance?
- List the operators that cannot be overloaded.
- Mention the use of Scope resolution operator.
- Define Polymorphism.
- What is the purpose of using catch statement?
- What are the types of templates?
Part – B
Answer ALL the questions (8 x 5 = 40 marks)
- (a) Distinguish between Class and Structure.
(or)
(b) Analyse the following code with respect to syntax and semantics:
Class C
{
intx; const int y; public: C(int a, int b)
{x=a; y=b}
};
- (a) What are copy constructors and explain their need? Compare copy constructor and operator
function=() by defining a string class with these functions.
(or)
(b) (i) When copy constructors are available why we require to overload=operator
in C++? Give an example.
(ii) Whether assignment operator is over loadable with friend function? Justify.
- (a) (i) Distinguish between early binding and late binding.
(ii) Explain how dynamic binding has been implemented in C++ with a program segment.
(or)
(b) What are the various parameter passing mechanisms supported by C++? Explain with
example.
- (a) If a derived class is to contain the public and protected members if its base class as protected
members, which access specifier must be used?
(or)
(b) Why is it important to ‘inline’ only small functions?
- (a) Explain function prototype with example.
(or)
(b) Explain user defined exceptions with example.
Part – C
Answer any TWO questions (2 x 20 = 40 marks)
- (a) Write a program to simulate a banking system in which the initial balance, acc_no, acc_type,
cust_name are read from keyboard. Provide the following methods.
- To make a deposit
- To withdraw an amount
- To know the balance
(b) Give the syntax of hierarchical inheritance.
- (a) What are the rules for overloading operators?
(or)
(b) Design an object oriented system for a Student Information System.
- (a) Explain class Templates and its types with example.
(or)
(b) With appropriate examples, Compare procedural, object oriented and Generic programming.
Latest Govt Job & Exam Updates: