problem with relational operators
When I run this program everything works fine except I cannot enter 0.016 for thickness. Can anyone give me some help on what the problem might be?
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
float length;
float height;
float thickness;
float weight;
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
cout << setprecision(2);
cout << "Please enter the package length(inches): ";
cin >> length;
cout << "\nHeight(inches): ";
cin >> height;
cout << "\nThickness(inches): ";
cin >> thickness;
cout << "\nWeight(pounds): ";
cin >> weight;
if (length >= 3.5 && length <= 4.25)
{
if (height >= 3.5 && height <= 6)
{
if (thickness >= 0.007 && thickness <= 0.016)
{
cout << "\nYour post card is a regular post card. ";
cout << "The cost to mail your post card is $" << ((weight / 0.0625) * 0.2)
<< ".";
}
}
}
else if (length > 4.25 && length < 6)
{
if (height > 6 && height < 11.5)
{
if (thickness >= 0.007 && thickness <= 0.016)
{
cout << "\nYour post card is a large post card. ";
cout << "The cost to mail your post card is $" << ((weight / 0.0625) * 0.3)
<< ".";
}
}
}
return 0;
}