Wipro TalentNext PBL
Topics Covered Hands-on Assignments for List
No. Hands-on Assignment Topics Covered Status
1
Develop a java class with a method saveEvenNumbers(int N) using ArrayList to store even numbers from 2 to N, where N is a integer which is passed as a parameter to the method saveEvenNumbers().
The method should return the ArrayList (A1) created. In the same class create a method printEvenNumbers()which iterates through the arrayList A1 in step 1, and It should multiply each number with 2 and display it in format 4,8,12….2*N. and add these numbers in a new ArrayList (A2).
The new ArrayList (A2) created needs to be returned. Create a method printEvenNumber(int N) parameter is a number N. This method should search the arrayList (A1) for the existence of the number ‘N’ passed. If exists it should return the Number else return zero.Hint: Use instance variable for storing the ArrayList A1 and A2.
NOTE: You can test the methods using a main method.
List ArrayList
2
- Create an application for employee management having following classes: a) Create an Employee class with following attributes and behaviors : i) EmpId Int ii) EmpName String iii) EmpEmail String iv) EmpGender char v) EmpSalary float vi) GetEmployeeDetails() -> prints employee details
b) Create one more class EmployeeDB which has the following methods. i) boolean addEmployee(Employee e) ii) boolean deleteEmployee(int empId) iii) String showPaySlip(int empId) iv) Employee[] listAll()
-
Do implementation of the above application with below two methods : I. Use an ArrayList which will be used to store the employees and use enumeration/iterator to process the employees. II. Use a TreeSet Object to store employees on the basis of their EmpId and use enumeration/iterator to process employees. [Hint: Use Comparable interface] Write a Test Program to test that all functionalities are operational.
List enumeration / Iterator
3
Create an ArrayList which will be able to store only Strings. Create a printAll method which will print all the elements using an Iterator.
List iterator
4
Create an ArrayList which will be able to store only numbers like int,float,double,etc, but not any other data type.
List ArrayList
5
Create an ArrayList of Employee( id,name,address,sal) objects and search for particular Employee object based on id number.
List ArrayList
6
Implement the assignment 1 using Linked List
List Linked List
7
Implement the assignment 1 using Vector
List, Vector
8
Write a program that will have a Vector which is capable of storing emp objects. Use an Iterator and enumeration to list all the elements of the Vector.
List, Vector