You are on page 1of 2

SCHOOL OF COMPUTER SCIENCE AND ENGINEERING

B.Tech, Fall Semester , 2023-24

Course Code : BCSE103E Submission Date: 10-11-23

Course Name : Java Programming Max. Marks :

Faculty-In-
Charge: : Dr. N. Balaji Slot:

1. Consider an integer array, the number of elements in which is determined by the user. The elements
are also taken as input from the user. Write a program to find those pair of elements that has the
maximum and minimum difference among all element pairs.

2. Write a program to create a directory that contains the following information.


(a)Name of a person
(b) Address
(c) Telephone Number (if available with STD code)
(d) Mobile Number (if available)
(e) Head of the family
(f) Unique ID No.
The program will support the following menu based activities:
(a) Create a database entry (The Unique ID number must be unique for every entry, the telephone
numbers of two or more persons can be same if and only if the head of family is same)
(b) Edit an entry (Must be identified by only the Unique ID number)
(c) Search by keyword (Any keyword may not be complete; even if the keyword matches partially with any
field, the corresponding information must be displayed)

3. Create an abstract class 'Animals' with two abstract methods 'cats' and 'dogs'. Now create a class
'Cats' with a method 'cats' which prints "Cats meow" and a class 'Dogs' with a method 'dogs' which prints
"Dogs bark", both inheriting the class 'Animals'. Now create an object for each of the subclasses and call
their respective methods.

4. Write a Java program to append the specified element to the end of a linked list.

5. Write a Java program to get the first and last occurrence of the specified elements in a linked list.

6. Write a Java program to store text file content line by line in an array.

7. Write a Java program to find the longest word in a text file.

8. Write a Java program to create an abstract class GeometricShape with abstract methods area()
and perimeter(). Create subclasses Triangle and Square that extend the GeometricShape class and
implement the respective methods to calculate the area and perimeter of each shape.
9. Write a Java program that reads a list of integers from the user and throws an exception if any
numbers are duplicates. (User Defined Exception)

10. Write a Java program to find the longest Palindromic Substring within a string.
Sample Output:
The given string is: thequickbrownfoxxofnworbquickthe
The longest palindrome substring in the given string is: brownfoxxofnworb
The length of the palindromic substring is: 16

You might also like