cout<<"Given the temperature is" <<temp<< "degrees and" <<depth<< "inches of snow accumulation.\n" <<(T,M,L)<< "will be plowed and salted." << endl;
}
return 0;
}
The instructions are, when snow depth exceeds 0.75 inches on trunklines and 1.5 inches on Major Streets and 3.25 inches on Local Streets. City crews will start plowing and or salting.
if the temperature is below 8 degrees then salting will not be done.
std::string T,M,L;
When you write that, the compile thinks T, M, L are variables that will hold data.
cin>>T,M,L; is interpreted as
1 2 3
cin>>T;
M;
L;
and hence interpreted as cin >> T;
Similarly (T,M,L == T) is read by the compiler as (L == T).
So like ne555 said, use a char variable to hold the choice that the user inputs and then compare the variable with single character constants 'T', 'L', 'M' etc.
std::cout<<"Given the temp is" <<temp<<"degrees and" <<depth<< "inches of snow accumulation" <<choice<< will be plowed and salted.
else if (choice == 'T') && (temp << 8) && (depth >> 0.75)
std::cout<<"Given the temp is" <<temp<<"degrees and" <<depth<< "inches of snow accumulation" <<choice<< will be plowed and not salted.