Problem Statement :
Write a java program in which -
1. declare a class Beach and make attributes as -
int - BeachId , String - BeachName , String Location , String type , int rating ,int avg person come
and along with the constructor . All the attribute should be private and implement their getter and setter .
2. Write a Solution class with main method . where you have to implement a static method findLeastRating where you have to pass array object along with the String and an integer value which you have to take form user .( where String refers to location and int refers to number of person come )
3. in findLeastRating method , you have to implement that if location of any array object matches with the given String value of location and avg number of person come is greater than integer value that is taken from user then print the rating which is least one . and there is no any value get then it simply returns 0 and display on screen " No data found" .
Input :
1001
A
north goa
small
4
1000
1002
B
south goa
big
5
2000
1003
C
puri
small
7
3000
1004
D
south goa
moderate
5
3000
1005
E
north goa
moderate
3
3500
Code :
Comments
Post a Comment