#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main ()
{
//displays rate info
cout << "The Fast Freight Shipping Company charges the fees below:" << endl << endl;
cout << "Weight of Package (in kilograms) ";
cout << " Rate per 500 Miles shipped " << endl << endl;
cout << "2 kg or less " << " is $1.10 " << endl << endl;
cout << "Over 2 kg. No more than 6 kg " << " is $2.20 " << endl << endl;
cout << "Over 6 kg. No more than 10 kg " << " is $3.70 " << endl << endl;
cout << "Over 10 kg. No more than 20 kg " << " is $4.80 " << endl << endl;
//displays shipping rules
cout << "The following are the Shipping Rules :" << endl << endl;
cout << "FFSC will not ship a distance less than 10 miles." << endl;
cout << "FFSC will not ship a distance more than 3000 miles." << endl;
cout << "FFSC will not ship weight more than 20 kg." << endl;
cout << "FFSC will not accept a weight of 0 kg or less." << endl << endl;
int GoodFlag=0;
cout << fixed << setprecision (2);
cout << "Enter the weight of the package." << endl;//asking user for weight of package
cin >> weight;
cout << "The weight of the package is " << weight << "kg." << endl;
if (weight <= 0)
cout << "The value has to be greater than 0 kg.";
else if (weight > 20)
cout << "The value has to be less than 20 kg.";
else
{
cout << "Enter the distance that the package is to be shipped." << endl;//asking for the distance to be shipped
cin >> distance;
if (distance < 10)
cout << "The value has to be greater than 10 miles." << endl;//prompting user for shipping rule violations
else if (distance > 3000)
cout << "The value has to be less than 3000 miles." << endl;
else
{
if (!GoodFlag)
{
cout << "This program has been terminated.";
}
else
{
cout << "Thanks a ton for using the FFSC." << endl;
}
}
}
system ("pause");
return 0;
}