Lab: Object Oriented Programming using Java
Date: 25/02/2026
Assignment -5
Q.1. A number array contains values from 1 to 20, but one number is missing and
another number is repeated. Write a program to find both the missing number
and the duplicate number.
Q.2. A library records the number of books issued each day for 15 days. Write a
program to determine which day had the highest issues, which day had the
lowest, and whether there exists a sequence of at least 3 days where the number
of books issued kept decreasing continuously.
Q.3. A university stores marks of 100 students in 3 internal tests in a 2-D array. Write
a program in Java to perform following:
a. Calculate best test (highest average marks)
b. Find topper of each test
c. Count number of students improving consistently (Test1 < Test2 < Test3)
d. Display sorted final averages
Q.4. Write a program in Java to create a class Student with attributes name and age.
Create one object, assign values, and print them.
Q.5. Write a program in Java to create a class Car with color and model. Create 2
objects and display their details.
Q.6. Write a program to create a class Circle with data member radius and methods
calculateArea() and calculateCircumference() to compute and display the area
and circumference of the circle.
Q.7. Write a program to create a class Student with data members name, rollNo, and
marks. Create a method to display student details and another method to
calculate grade based on marks.
Q.8. Write a program to create a class BankAccount with data members
accountNumber and balance. Write methods deposit() and withdraw() to update
and display balance.