Subject: Object-Oriented Programming Lab
Mode of Examination - Computer-Based
Duration: 02:00 Hrs
Max. Marks: 50
All the questions are compulsory
Declare a class named Student with instance variables for Name, Roll Number,
Branch, and Programme. The two methods, readData and printData, are unimplemented.
To input student data, consider two categories: undergraduate (UG) and postgraduate (PG).
UG and PG are subclasses of Student. The UG class includes a variable for result, while
the PG class contains variables for resultpg, number of books published, number of papers
published, and number of patents. The UG class extends a Bachelor's program,
incorporating college name, along with readData and printData methods. The Master, PhD,
and Scientist classes inherit from PG. The Master class includes specialization, a number
of projects, and the readData and printData methods. The PhD class has variables for the
PhD topic and supervisor's name, with corresponding methods. The Scientist class contains
a variable for research area, along with its readData and printData methods. Every class
should have a parameterised constructor to assign the relevant data and utilize appropriate
visibility modifiers for every instance variable and method. Define one additional class
having a main method, create the object of the necessary classes and invoke the methods.
Your program should utilize an abstract class or interface where appropriate, handle
exceptions during input, store a single object’s information in a file, and retrieve and sort
the records. Provide a complete program to implement this scenario.
Answer the following questions based on the scenario provided.
Identify the Object-Oriented Programming paradigms suitable for
Q1 implementing the above program. Determine classes, their relationships, [10]
and draw a UML class diagram.
Q2 [10]
How concepts such as abstract classes and interfaces will help complete
the solution. Why exception handling is necessary and how it helps
manage runtime errors. Comment on the method you will use to sort
student records.
Q3 Implement complete program to represent the given scenario. [30]
Rubrics
Q1 OOP Paradigms Classes & Relationship Class Diagram
04 Marks 04 Marks 02 Marks
Q2 Interface/Abstract Exception Handling Sorting
Class
04 Marks 04 Marks 02 Marks
If successfully executed: -
Q3 Student UG Class PG Class & Exception File Comparator
Interface & Masters,Phd Handling Handling... and lambda
Bachelors & Scientist Read and
Write
05 Marks 05 Marks 05 Marks 05 Marks 05 Marks 05 Marks