Problem Statement :
Write a java program in which -
1. declare a class Team and make attributes as -
int - tId , String tName , String tCategory , String tGameName ,int tNumberOfPlayer
and along with the constructor . All the attribute should be private and implement the getter and setter .
2. Write a Solution class with main method . where you have to implement a static method findTeam in which you have to pass three input , Array object , String parameter as category and int parameter as number of player .
3. in findTeam method , you have to implement it and if any of the array object value matched with the given condition then it should return that object or else print " no match Found ".
condition : String parameter must match with the tCategory of array object and int parameter must match with the tNumberOfPlayer and tCategory must be divisible with tNumberOfPlayer .
4. in output you have print all the details of the returned object . or else if no object returned then print " no match Found " .
5. length of array must be taken by user choice .
.
Input :
3
1
Kolkata
yellow
cricket
11
2
Mumbai
blue
football
15
3
Delhi
green
tennis
8
yellow
11
Output:
1
Kolkata
yellow
cricket
11
Source Code :
Comments
Post a Comment