Assignment-2 PBLJ Theory
Assignment-2 PBLJ Theory
Assignment -2
Set – 1
1. Create an ArrayList of Employee( id,name,address,sal) objects and search for particular 2.5 marks
Employee object based on id number.
2. Create a class Employee and implement the below method in the class. 2.5 marks
Write Junit testcases to test the below given method:
Sample Output:
Enter the file name
Input.txt
Enter the character to be counted
r
File 'Input.txt' has 99 instances of letter 'r'.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Set – 2
1. Write a program to store a group of employee names into a HashSet, retrieve the elements 2.5 marks
one by one using an Iterator.
2. Write a java program that connects to oracle database, queries the inbuilt table “emp” and 2.5 marks
displays the first two columns (empno using column index and ename using column name
) of all the rows.
3. ABC International School wants to computerize students details. The school maintains a 5 marks
database of students in Oracle. The student table contains information related to students
and is shown in the following student table structure.
Column Name Type Constraint
Rollno Number (4) Primary Key
StudentName Varchar (20) Not Null
Standard Varchar (2) Not Null
Date_Of_Birth Date
Fees Number (9,2)
Set – 3
1. Create Collection called TreeSet which is capable of storing String objects. The Collection 2.5 marks
should have the following capabilities
a)Reverse the elements of the Collection
b)Iterate the elements of the TreeSet
c) Checked if a particular element exists or not
3. i) Create the following class and implement the method to check whether given string is a 5 marks
palindrome and return the result,
Class Name : MyUnit
Method : palindromeCheck(String):boolean
(Hint: If the reversed string is equal to the actual string is palindrome string. Ex: madam,
mom, dad, malayalam )
ii) Create a Junit test class to test the above class.