Problem Statement :
Subscribe Please : click here Subscribe Please : click here
Create a class Course with the below attributes:
String courseName;
String instructor;
int studentAttend;
boolean present;
String city ;
Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence .
Create class Solution with main method. Implement one static methods – findCategory in Solution class.
Subscribe Please : click here
findCategory method :
This method will take two input parameters -array of Course objects and string parameter name i.e courseName. The method will return the the String value that is Category on the basis of below condition .
If studentAttend present less than 1500 and greater than equals to 1000 then category is "Diamond" .
If studentAttend present less than 1000 and greater than equals to 500 then category is "Golden" .
If studentAttend present less than 500 then category is "Silver".
If no Course with the given courseName is present in the array of Course objects, then the method should return null.
If the returned value is null then it should print “No match found".
but if any matches then return the category as per above condition .
Thank You !
Subscribe Please : click here Subscribe Please : click here
Code :
Subscribe Please : click here Subscribe Please : click here
Comments
Post a Comment