[go: up one dir, main page]

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

Dse2153 Oop QP (D3)

The document outlines the in-semester examination for Object Oriented Programming for B.Tech students, detailing the exam date, time, and maximum marks. It includes six questions covering topics such as dynamic dispatch, exception handling, constructor overloading, differences between List and Map, benefits of interfaces, and file processing. Each question requires a program demonstration based on specific scenarios related to 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)
4 views2 pages

Dse2153 Oop QP (D3)

The document outlines the in-semester examination for Object Oriented Programming for B.Tech students, detailing the exam date, time, and maximum marks. It includes six questions covering topics such as dynamic dispatch, exception handling, constructor overloading, differences between List and Map, benefits of interfaces, and file processing. Each question requires a program demonstration based on specific scenarios related to 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
You are on page 1/ 2

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 How does the dynamic dispatch method overrides the method in multilevel inheritance 4
and what are the advantages of the same? Write a suitable program to demonstrate the
same using the following scenario:

Create a class “Literature” with two attributes as “title” and “author” and also a method
as “print()” to print the title and author details. Now extend two classes from Literature
class as “Book” and “Poem”. Let “Book” class hold attributes as “publisher”, “genre”,
“author” and “title” with a method “print()”. Let “Poem” class hold attributes like
“style”, “title”, “author” with a method “print()”. Now show how multiple inheritances
and dynamic method dispatch are possible for the above scenario. Show how super,
this and final keywords are used.

2 Define exception handling and list at least 6 common Java exceptions that are handled 4
by Java. Write a suitable program to demonstrate the exception handling using the
following scenario:

A program that accepts an integer between 1 and 12 to display the respective month.
Raise an Input Mismatch Exception. Also, if the user enters a value less than 1 and
more than 12, the program should raise an Array Index Out of Bounds Exception.
[Note: Use Date class to display the month]

3 What is constructor overloading in object-oriented programming? Write a suitable 3


program to demonstrate the same using the following scenario:

Create a class “Polygone” and calculate the area of the square, rectangle, triangle,
equilateral triangle, and circle. Consider a switch case where the user can choose the
polygon of his/her choice and display the area of the polygon. Show constructor
overloading to pass the different parameters for the method “area()”.

4 What are the differences between List and Map in Java? Write a suitable program to 3
display the same using the following scenario:

The Class “College” has a list “courses” and a Map “subjects” to store only 10 string
entries. If there is no item, then collections will have “Null” items. Class “College” has
methods “input”, “compare” and “output” to do the corresponding tasks. The method
“Compare” throws “SimilarEntryFoundException” when “course” and “subjects” have
Page 1 of 2
duplicate items in the collection. The class “MainClass” creates an array of “College”
objects to store 10 entries.

5 How do interfaces benefit from the inheritances in Java programming? Write a suitable 3
program to demonstrate the same using the following scenario:

The class “ClassRoom” has “seatingCapacity”, and “ACAvailable” attributes. The


class “Calendar” has “dateAndAttendeeCount” attribute. The class “Reservation” has a
method “checkPossibility” to check whether the class can be scheduled or not. The
“MainClass” takes entries for 10 classrooms and 15 events for the calendar and
displays the possibility of scheduling.

6 Write a program to read alternate characters from the file “exam.txt” in class 3
“CharProcess”. The method “alter” inserts the real number between the characters and
stores the string content in string “s1”. The method “storeFile” writes the charter
followed by even number into file “even.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