For some reason my met variable cannot be used as a function in my last while statement, even though my other two variables can be. When i compile I get the error: '(met <= 2.0e+1)' cannot be used as a function|. How do i fix this?
// Garbage Collection. Michael Heusner.
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int reg_lim, met_lim, glass_lim;
double reg, glass, met;
double total;
double reg_ratio, glass_ratio, met_ratio;
reg_lim= 50;
glass_lim= 20;
met_lim= 20;
cout << "How much regular, glass, and metal garbage do you have?" << endl;
cin>> reg;
cin>> glass;
cin>> met;
total= met+glass+reg;
cout<< "The total number of bags is "<< total<< endl;
met_ratio= met/total;
reg_ratio= reg/total;
glass_ratio= glass/total;
cout<< "The metal ratio is "<< met_ratio<< endl;
cout<< "The glass ratio is "<< glass_ratio<< endl;
cout<< "The regular ratio is "<< reg_ratio<< endl;
if( met==reg==glass)
{
cout<< "All garbage amounts are the same."<< endl;
}
else if (reg> glass && met)
{
cout<< "Regular is the largest."<< endl;
}
else if (glass> met && reg)
{
cout<< "Glass is the largest."<< endl;
}
else if (met> glass && reg)
{
cout<< "Metal is the largest."<< endl;
}
while( reg <= 50) (met <= 20) (glass <= 20);{