Quiz Space

Java OPPE 1: January 2026 (January 2026 term)

Question 1

+25 marksProgramming

Write Java code that gives a simple demonstration of how a set of student registration requests is processed in a department of a college. It accepts a specific number of seats as input, and prints whether the registration is successful or not, based on the remaining seats left. The code uses the concept of inner classes, and has the following components:

  • Interface Registerable has an abstract method register().
  • Class Department with:
    • Instance variable name (String) representing the department name
    • Constructor to initialize the instance variable
    • An inner private class DeptEnquiry that has/does the following:
      • reqseats, avalseats as instance variables that hold the number of requested seats and available seats, respectively.
      • Implements interface Registerable (whose method register returns a string that describes whether registration is successful or not), which enables its object to be accessible from outside the class Department.
      • Constructor to initialize the instance variables
      • Method public String register() checks whether avalseats is less than reqseats. If it is less, then it returns Cannot register, else it returns Registered successfully available seats are <available seats>.
    • Method enrollRequest(int) that takes the number of seats to be registered as an argument and returns a Registerable object on which method register() can be invoked.
  • Class Student has method main that does the following:
    • Creates an object of Department with the name DCSE. Using this object, it invokes method enrollRequest to obtain a Registerable object, and invokes method register on it.

What you have to do:

  • Define method enrollRequest() in class Department

Question 2

+25 marksProgramming

An employee portal records the number of requests raised by employees in different request categories (such as Leave, Payroll, and IT Support). Given a list of request records, write a Java program to compute the total number of requests for each category. Complete the program as specified below.

Class RequestRecord has the following members:

  • Private instance variables: String category and int count
  • A constructor to initialize the instance variables
  • Method getCategory that returns the request category
  • Method getCount that returns the request count

Class EmployeePortal has/should have the following members:

  • Define method aggregateRequestsByCategory that takes a List<RequestRecord> and returns a Map<String, Integer> with category names as keys and total request counts as values, in the order in which the categories first appear.
  • main method that does the following:
    • Accepts input to instantiate 5 RequestRecord objects. The input is accepted in the order: category, count.
    • Adds the records to a List<RequestRecord> object
    • Invokes method aggregateRequestsByCategory
    • Prints each category along with the total number of requests

What you have to do:

  • Define method aggregateRequestsByCategory in class EmployeePortal.

More on the Java OPPE 1 Jan 2026 paper

The IIT Madras BS Programming Concepts using Java (Java) OPPE 1 paper sat on Jan 2026, in the January 2026 term (T1 2026): 2 questions for 50 marks in 180 minutes. The first 2 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureJava OPPE 1 Jan 2026 at a glance
TermJanuary 2026 term (T1 2026)
SubjectProgramming Concepts using Java
Course codeBSCS2005
Questions2
Marks50
Duration180 min
Programming2
Official paperOPPE 1, Jan 2026
Negative markingNo negative marking.
Updated

Same OPPE 1, other subjects

More Java