B.E/B.

Tech DEGREE EXAMINATION Nov/Dec 2006 Third Semester Computer Science and Engineering CS 1204 - Object Oriented Programming (Regulation 2004) Time: 3 hours Maximum marks: 100 Answer ALL questions PART A (10 x 2 =20 marks) 1.Name the mechanism that binds together code and the data it manipulates. 2.What are the applications of the scope resolution operator : : in C++? 3.What are the two parts of a class specification? 4.What is an operator function? Describe the syntax of an operator function. 5.Why is necessary to include the file iostream in all our programs? 6.Name the two ways in which a file can be opened. 7.What is default for methods in Java? 8.What is the need for Java Virtual Machine? 9.What is a package? 10.What is an Exception?

PART B (5 x 16 = 80) 11. (a) Explain the following concepts Object Oriented Programming: (i) Data abstraction (ii) Inheritance (iii) Polymorphism and

(iv) Objects in detail with an example (16) (Or) (b) (i) List out any five merits of Object Oriented methodology. (b) (ii) Compare and contrast the following Control structures with example : if …… else statement & switch statement and do …… while & the while statement. (16) 12. (a) Write a program to overload = operator .Assign values of data members of one object to another object of the same type. (16) (Or) (b) Write a C++ program using inheritance to implement the following A newspaper agent pays two variant rates for the delivery of newspapers. A delivery boy can earn Rs.2 on a morning delivery but only Rs. 1.50 on an evening delivery. Boys are salaried either for a morning delivery or for an evening paper round but not for both. Read (input) the code for round (0 for morning and 1 for evening) and the number of total papers rounds in one week done by a boy and compute his earnings and display it. 13. (a) Write a program to write and read data in a file using object I/O functions write() and read (). Declare class with data members name [20],int billno,int amount_debited and int received_amount and int balance.Add 10 records and display the list of person with balances.The user should have a facility to modify the existing records (16) (Or) (b) (i) Describe the various file modes and its syntax (6) (ii) Discuss the need for exception with try, catch and throw keywords (10) 14. (a). Write short notes on the following: final class, abstract class, modifier final, inner classes (16) (Or)

(b) (i) State the rules for creating an identifier in Java (16) 15. (a) Discuss how interface is implemented in Java with an example. (16) (Or) (b) What is a thread? State how synchronization is dealt while using multithreading . (16)

Sign up to vote on this title
UsefulNot useful