Question Paper Code : 70074
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2022.
Third Semester
Computer Science and Engineering
CS 3391 — OBJECT ORIENTED PROGRAMMING
(Common to : Biomedical Engineering/Computer Science and Design/Computer Science and Engineering (Artificial Intelligence and Machine Learning)/Computer Science and Engineering (Cyber Security)/Computer and Communication Engineering/Medical Electronics/Computer Science and Business Systems/Information Technology)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
Java Language is Platform Independent. Justify your answer.
- 2.
Difference between Method and Constructor.
- 3.
Differentiate Method overloading and overriding.
- 4.
Can we access parent class variables in child class by using super keyword?
- 5.
Define Arithmetic Exception with example.
- 6.
Name the two ways to create a thread in Java.
- 7.
What is Thread Pool?
- 8.
When a class must be declared as abstract?
- 9.
What is a layout manager and what are different types of Layout managers available in java AWT?
- 10.
Differentiate Hbox and VBox.
PART B — (5 × 13 = 65 marks)
- 11.(a)
- (i)Differentiate between object oriented programming and procedure oriented programming.(7)
- (ii)Write a Java program to find the greatest of three numbers.(6)
- Or
- (b)
- (i)Explain constructor with an example.(6)
- (ii)Write a java program to display the grade of the students by using get() method to get marks and compute() method to compute the average and display() method to display the grade of the student.(7)
- 12.(a)
- (i)Write a java program for library interface with drawbook(), returnbook() and checkstatus() methods.(8)
- (ii)Explain Method overloading with an example.(5)
- Or
- (b)
- (i)What are the advantages of using packages?(5)
- (ii)Illustrate how to add classes in a package and how to access these classes in another package.(8)
- 13.(a)
Create software for departmental stores to maintain the following details like item_no, item_description, requested quantity, cost price. Provide the options to update the stock. Calculate the selling price (SP = CP*20%). Create an exception whenever the selling price of item exceeds the given amount.
- Or
- (b)
- (i)Discuss about try, catch and finally Keywords in Exception Handling with an example.(8)
- (ii)List and explain Data types and their Corresponding Wrapper class.(5)
- 14.(a)
- (i)Explain string buffer class with example.(6)
- (ii)Outline parameter type bounds with an example.(7)
- Or
- (b)
Apply the String handling functions to do the following operations :
- (i)Compare the two strings
- (ii)Reverse the String - "Happy".
- 15.(a)
- (i)List and explain the various layouts in java GUI.(8)
- (ii)Explain the four types of buttons swing.(5)
- Or
- (b)
Discuss the following with example:
- (i)Mouse listener
- (ii)Mouse motion listener
PART C — (1 × 15 = 15 marks)
- 16.(a)
Create a Central Library management system with libraries in different locations in a city. Each Library can order a book from the central library and give it to the requesting customers. Availability of that book should be updated on each lending. Consider each library as a thread that requests for a book for purchase from the central library. If the requested book count is less than zero, then central library provides an appropriate message to the appropriate requesting library. Implement using Multithreading.
- Or
- (b)
With neat example, explain java AWT Menu bars and Menu items.