0% found this document useful (0 votes)
21 views2 pages

Dse2153-Oop - QP - (D2)

The document outlines the examination details for the Object Oriented Programming subject for B.Tech students, including the date, time, and maximum marks. It presents six questions that cover various concepts such as inheritance limitations, exception handling, polymorphism, collection frameworks, interfaces, and file operations in Java. Each question requires a programmatic demonstration of the concepts discussed.

Uploaded by

batmanflyinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Dse2153-Oop - QP - (D2)

The document outlines the examination details for the Object Oriented Programming subject for B.Tech students, including the date, time, and maximum marks. It presents six questions that cover various concepts such as inheritance limitations, exception handling, polymorphism, collection frameworks, interfaces, and file operations in Java. Each question requires a programmatic demonstration of the concepts discussed.

Uploaded by

batmanflyinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

III SEM. B.

TECH (DSE) IN-SEMESTER EXAMINATIONS


Dec 2021
SUBJECT: OBJECT ORIENTED PROGRAMMING [DSE-2153]
Date of Exam: 16/12/2021 Time of Exam: 10:30 am– 12:00 noon Max. Marks: 20

Instructions to Candidates:
❖ Answer ALL the questions
❖ Missing data may be suitable assumed

1 What are the limitations of Inheritance in Java platform? Write a suitable program to 4
demonstrate the same using the following scenario:

Consider three classes: “Student”, “Exam”, and “Results”. The “Student” class has
data members as “RegNo” (int), “name” (String), and “email” (String). Create the class
“Exam” by inheriting the “Student” class. “Exam” class has data members to represent
the marks scored in five subjects. Derive a “Result” class from “Exam” class and it
has its own data member “isPass” which is True or False based on the marks of a
student in the exam. Assume the passing marks to be 40 in all subjects. Show how
super, this, and final keywords are used.

2 What are the roles of exception handling in an application? How does it help in 4
improving the performance of the program? Write a suitable program to demonstrate
the same using the following scenario:

Generate an array based on the given value and size of the array. Where the array
elements will contain the multiples of the given value and display the array elements
with the size specified. For example:
Input: Value : 7 Size: 5
Output: [7,14,21,28,35]

Display the array with Array Index Out Of Bounds Exception for size=0 and Input
Mismatch Exception.

3 How does polymorphism improve the reusability of a code in object-oriented 3


programming? Demonstrate the same using the following scenario:

Consider a class “ReverseInt”. For any input value provided by the user, the reverse of
the value needs to be printed. Also, check if the integer is a palindrome, if so print an
appropriate message on the console. Display constructor overloading for integer and
string arguments.

4 What would be the ideal choice of collection framework for the following scenario? 3
Justify your answer with a suitable program for the following scenario:

The class “Lab” has a collection framework interface that stores the name of the

Page 1 of 2
students. The method “Enter” takes the entry of the student’s name as they enter into
the lab. The method “check” throws “LateEntryException” when 35th student enters
the lab. The student entries are displayed in the order in which they enter the lab by the
“display” method.

5 How do interfaces work as an abstract class? What are the limitations of interfaces 3
compared to abstract classes? Demonstrate the limitations for the following scenario
using a program:

The class “Vehicle” has the attribute “wheelCount” and method “onRoadPrice”. The
on-road price calculation uses ex-showroom price, road tax, and insurance to calculate.
The vehicles with 4 wheels are considered as light vehicles and above 6 are considered
as heavy vehicles. The classes “LightVehicle” and “HeavyVehicle” uses “Vehicles”
classes for the operations. The main class “MainClass” creates objects for
“LightVehicle” and “HeavyVehicle” to store 2 vehicle details each.

6 Write a program to read 10 strings from the file “text.txt” in class “FileOperation”. The 3
strings are then sorted and stored in an array. In method “vowels”, the vowels are
removed and stored in an array. Then the method “count”, counts total consonants and
prints them into a new file “count.txt”. The main class “MainClass” creates objects and
calls the methods to do tasks. Consider suitable exceptions in the program.

Page 2 of 2

You might also like