Problem Statement :
Subscribe Please : click here
Write a java program in which -
1. declare a class Vegetables and make attributes as -
int - vegetableId , String vegetableName , int price , int rating
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 findPrice where you have to pass array object along with the rating which you have to take form user .
3. in findPrice method , you have to implement that if the rating of vegetable is greather than the rating that user has given then return that vegetable object as output which has minimum rating or if no any vegetables are present which satisfy the above condition then simply print "No Match Found".
4. if it any return any object then print the price of that object .
Subscribe Please : click here Subscribe Please : click here
Code :
import java.util.*;
Comments
Post a Comment