string rating(bool ozone, bool no2, bool so2)
{
string result;
int count = 0;
if(ozone == true)
{
count++;
}
if(no2 == true)
count++;
if(so2 == true)
count++;
if(count == 3)
result = "Gold Star";
if(count == 2)
result = "Silver Star";
if(count == 1)
result = "Ok";
if(count == 0)
result = "Failing";
return result;
}
bool in_compliance(float standard, float first, float second, float third)
{
int count = 0;
if(first <= 0 || second <= 0 || third <=0)
return false;
if(standard >= first)
count++;
if(standard >= second)
count++;
if(standard >= third)
count++;
if(count >= 2)
return true;
else
return false;
}
jschri4 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.