Making a guess here, but I think what you want is:
1 2 3 4 5 6 7 8 9 10 11 12
if(aFeat.compare =="good")
{
// Code
}
elseif (aFeat.compare =="not good")
{
// Code
}
else // for fair Or continue with the "else if" for more.
{
//Code
}
not sure if new c++ has a tri-state or not but that aside, you can do it generally with 2 approaches.
first let me comment that you want to be very careful here with equality against floating point values.
approach 1
enum quality
{
good, fairly_good, not_good, max_quality
};
quality q;
if(condition)
q = good;
else
if(other condition)
q = 'not_good'
etc...
you can use a switch off q, or comparisons.
now you can use bitwise operators against the 000111 bits
which is sometimes useful. You do this if you can have 2 of the conditions at once, for example superbool & 3 checks both 1 and 2, or superbool & 5 checks 4 & 1, etc.
This is less intuitive than the enum but it allows you to simplify combined conditions to a single condition.
you can *combine* these techniques by assigning powers of 2 in the enum (default enums start at 0 and increment 1,2,3,..)
As I noted before, std::string.compare returns 0 if the strings are equal. Your comparisons are testing not equal to zero, therefore your comparisons fail.
There is a more intuitive way to compare strings using the == operator.
I accepted that "aFeat.compare" is something that points to a std::string. Unless I have missed something with the standards past C++11 aFeat.compare("not good") is not the way to compare two strings.
I gave you a start that you could finish.
Look back at what I showed you and see what the difference is between the two.
chained if statements is great for 3. The methods I was showing are general purpose for places where you might have 5 or 8 or whatever numbers of categories to handle.
If you want to chain if statements you only need 2 to cover 3:
if neither if statement happens, it was initialized to not_good and retains that value as a default.
enums just name the conditions so they are easy to read and use in code. It is identical to use of an integer. Using the binary / bitwise logic is identical to using an integer or an enum, with the difference being that you only use powers of 2 which turns each bit of the state into a boolean, effectively, and again this allows you to do simplify some statements if you have multi-condition statements (this is not normally worth doing until the # of states reaches 4 or more, otherwise negative logic is sufficient, that is if you want 1 and 2, then you can pick not 3 instead).