Object-Oriented Programming Using Java Lab
BCA-2004 P
Program Index
Program Page Date Teacher’s
Name of the Program No.
No. Sign.
1 WAP to read two numbers from user and print their
product.
2 WAP To print the square of a number passed through
command line arguments.
3 WAP to send the name and surname of a student through
command line arguments and print a welcome message for
the student.
4 WAP to find the largest number out of n natural numbers.
5 WAP to find the Fibonacci series & Factorial of a number
using recursive and non-recursive functions.
6 WAP to multiply two given matrices.
7 WAP for sorting a given list of names in ascending order.
8 WAP that checks whether a given string is a palindrome or
not. Ex: MADAM is a palindrome.
9 WAP to to read n number of values in an array and display it
in reverse order.
10 WAP to perform mathematical operations. Create a class called
AddSub with methods to add and subtract.
Create another class called MulDiv that extends from AddSub
class to use the member data of the super class.
MulDiv should have methods to multiply and divide A main
function should access the methods and perform the
mathematical operations.
11 WAP to create a JAVA class called Student with the
following details as variables within it.
a. USN, NAME, BRANCH, PHONE, PERCENTAGE
b. Write a JAVA program to create n Student objects and
print the USN, Name, Branch, Phone, and percentage of
these objects with suitable headings.
12 WAP that displays the number of characters, lines
and words in a text.
13 WAP to create a class called Shape with methods called
getPerimeter() and getArea(). Create a subclass called Circle
that overrides the getPerimeter() and getArea() methods to
calculate the area and perimeter of a circle.
14 WAP to create a class Employee with a method called
calculateSalary(). Create two subclasses Manager and
Programmer. In each subclass, override the calculateSalary()
method to calculate and return the salary based on their
specific roles.
15 WAP to using an interface called ‘Bank’ having function
‘rate_of_interest()’. Implement this interface to create
two separate bank classes, ‘SBI’ and ‘PNB’ to print
different rates of interest. Include additional member
variables, constructors, also in classes ‘SBI’ and ‘PNB’.
16 WAP to for the class book and then import the data from
the package and display the result.
17 WAP for finding the cube of a number using a package for
various data types and then import it in another class and
display the results.
18 WAP for demonstrating the divide by zero exception handling.
19 WAP that reads a list of integers from the user and throws an
exception if any numbers are duplicates.
20 WAP to Create an exception subclass UnderAge, which
prints “Under Age” along with the age value when an
object of UnderAge class is printed in the catch statement.
Write a class exceptionDemo in which the method test()
throws UnderAge exception if the variable age passed to it
as argument is less than 18. Write main() method also to
show working of the program