Skip to main content

Posts

Showing posts from December, 2021

December 23 java coding question PRA solution

23 dec pra java coding question solution. Question: Create the class Student with below attributes. id-int name-String marks-int age-int write getters and setters and parametrized constructor in Student class. Create class Solution with main method. implement 2 static methods-findStudentWithMaximumAge and searchStudentById in Solution class. findStudentWithMaximumAge method:     This method will take the Array of the Students objects as input and  returns the Student object having maximum Age.   For this method,the main method should print the student object details with maximum age as it is.    searchStudentById method:     This method will take 2 input parameters.Array of the Students objects and an int value  id.and returns the Student object having the mentioned id  if found, else return null if not found.   For this method ,main method should print the details of Student objects  as it is,if the returned value is not null. or it should print  "No Student found with mentioned

tcs ira 29November 2021 java coding question solution.

 Question: Create the class Bank with below Attributes. bankId-int bankName-String numberOfCustomers-int city-String  write parametrized constructor as well in Bank Class. Create class Solution  with main method. Implement 2 Static methods-findAvgNumberOfCustomersByCity and  getSecondLowestNumberOfCustomersBank in Solution class. findAvgNumberOfCustomersByCity method-This method will take two input parameters.Array of Bank Objects and String Parameter city and will return the average number of customers of bank from array of Bank Objects for the  given city.    If no banks with given city present inside the array of the Bank Objects, then the method should return 0. The main method should print the average of the number of Customers if the  returned value is greater than 0.Else main method will print "Bank not Found". getSecondLowestNumberOfCustomersBank method- This method will take 1 input  Parameter that is Array of Bank Objects and return Bank Object having the  second lo