Object Oriented Programming Methodology - May 2015
Computer Engineering (Semester 3)
TOTAL MARKS: 80
TOTAL TIME: 3 HOURS (1) Question 1 is compulsory.
(2) Attempt any three from the remaining questions.
(3) Assume data if required.
(4) Figures to the right indicate full marks.
1 (a) Write a program to calculate GCD of two numbers in JAVA. (5 marks)
1 (b) Explain any three features of JAVA. (5 marks)
1 (c) Draw and explain applet life cycle. (5 marks)
1 (d) Explain wrapper class and its applications. (5 marks)
2 (a) Write a program in JAVA to display following pattern. (Take input for number of rows from command line)
2 (b) Write a note on System.arraycopy(). (5 marks)
2 (c) Identify classes and their attributes and draw the relationships specified by following problems.
i) Bank maintains two kinds of accounts for customer, Saving accounts & current account. Saving account provides compound interest and withdrawal facility. Current account provides cheque book facility but no interest.
ii) Library maintains books and magazines. A student can issue a book or return a book. A fine is charged if book is returned after 8 days. The magazines are not issued, but student can read it in library. (10 marks)
3 (a) What is a package? Explain with example the steps to create package and add a class or an interface. (10 marks)
4 (a) What is Exception? Explain how JAVA handles an Exception using following keywords:
try, catch, throw, throws & finally. (10 marks)
4 (b) Write a program to read and display details of ten Employees with following specifications:
Data Members: Emp_ID, Emp_name. Emp_Salary
Parameterized constructor to initialize data members of Employees and Member functions:
Display ()-to display information of all employees. (10 marks)
5 (a) With the help of suitable example explain how threads are created in JAVA. (5 marks)
5 (b) Explain multiple inheritance in JAVA with example. (5 marks)
5 (c) Write a program to count the number of alphabets, digits and special symbols from string. (10 marks)
Write short notes on (any four):
6 (a) Method overloading & overriding (5 marks)
6 (b) Static data members & methods (5 marks)
6 (c) Abstract class & methods (5 marks)
6 (d) Constructor & its type (5 marks)
6 (e) JVM. (5 marks)
3 (b) Write a program to create vector objects with student names. Program should perform following operations based on choice:
i) Add student name-To add new student name in the vector.
ii) Remove student name-Removes student name if already exists else display appropriate message.
iii) Display - Display contents of vector.(10 marks)