Object Oriented Programming Methodology - Dec 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) Explain how Java is platform-independent and high performance.(5 marks) 1 (b) Explain System.arraycopy()(5 marks) 1 (c) Difference between abstract class and interface.(5 marks) 1 (d) Write an applet program to draw circle, rectangle and polygon.(5 marks) 2 (a) Consider the Railway System:
i) Stations, tracks connecting stations.
ii) Trains with name & ID
iii) Train schedules record the time a train passes through each station on its route. Assume that each train reaches its destination on same day and every train runs everyday For each train on its route, store (a) time in (b) time out (c) Sequence no so stations in the route of a train can be ordered by sequence no.
iv) Passenger booking consisting of train, date, from station, to station, coach, seat and passenger name.
Draw class diagram for above scenario. Show clearly the relationship among participating classes.(12 marks) 2 (b) Draw Sequence diagram for passenger booking his ticket at IRCTC website.(8 marks) 3 (a) Write a program to display area of square triangle and circle. Make use of interface to define templates of methods to be implemented in desired classes.(10 marks) 3 (b) Write a program to check whether the entered four digit number is vampire or not. Combination of digits from this number forms two 2-digit number. When they are multiplied by each other, we get original number.
eg: 1260=21*60.(10 marks) 4 (a) In a garden, trees are maintained. A tree has following set of attributes:-
Tree code, heights, base and amount spent on the tree so far. Define Tree class, its constructor, display() and update() that updates tree information.
Define derive class Mango tree that has additional yield attribute.
Define Garden class and display information of a tree and a Mango Tree.(10 marks) 4 (b) Write the help of suitable example. Explain multithreating in terms of following:
i) Creating threads, extending Thread class
Life-cycle of thread.(10 marks) 5 (a) Write a program to read five names of students from command line and store them in a vector. Sort list in alphabetical order and display using Enumeration interface.(8 marks) 5 (b) Explain cohesion and coupling with suitable example.(8 marks) 5 (c) What are recursive functions? Demonstrate the concept with Fibonacci program.(4 marks)
Write short notes on (any four):
6 (a) Life cycle of Applet.(5 marks) 6 (b) Static Members(5 marks) 6 (c) Thread Synchronization.(5 marks) 6 (d) JVM(5 marks) 6 (e) Collection classes.(5 marks)