i wrote a code which should accept only two values, but it seems to accept any values instead. can some show me where i went wrong.
sorry about the long code, still a newbie at this.
double hr::change_r(double sr) //implementation from class section
{
dr = sr;
if(sr == 17)
return 17;
else
return dr;
}
int main() // the main section
{
int s
cout<<"Enter amount: ";
cin>>s;
if (HR.change_r(s) == 11)
{
cout<<"regular\n";
}
if (HR.change_r(s) == 17)
{
cout<<"irregular\n";
}
if((HRoom.change_rate(season) < 150.00) && (HRoom.change_rate(season) > 150.00) || (HRoom.change_rate(season) < 175.00) &&(HRoom.change_rate(season) > 175.00))
{
cout<<"Incorrect room rate entered";
cin>>season;
while((HRoom.change_rate(season) < 150.00) && (HRoom.change_rate(season) > 150.00) || (HRoom.change_rate(season) < 175.00) &&(HRoom.change_rate(season) > 175.00))
{
cout<<"Please re-enter the room rate \n";
cin>>season;
}