Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return message not number

Status
Not open for further replies.

LittleRedHat

Instructor
Apr 20, 2001
202
GB
Instead of returning 1 - 4 I would like this to return "Do this", "Do that", "Do the other", "Do nothing". The problem is I don't know/can't work out how. Help would be appreciated.

WTA

LRH

/*
Java Class for applying rules relative to the result
of the range and average calulation
*/
public class SampleRulesClass{
private int matchRule;

public int GetRule (double rangeAvResult){
matchRule=0;
if (rangeAvResult <=0.1)
matchRule=1;
else if (rangeAvResult >0.1 && rangeAvResult<=0.2)
matchRule=2;
else if (rangeAvResult >0.2 && rangeAvResult<=0.3)
matchRule=3;
else if (rangeAvResult >0.3)
matchRule=4;

return matchRule;
}
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top