1. //Jose Ed. Dieck
  2. //Prob 13 Shipping Charges
  3.  
  4. #include<iostream>
  5. #include<iomanip>
  6. using namespace std;
  7.  
  8. int main(){
  9.  
  10.     float weight, cost;
  11.     int distance;
  12.  
  13.     cout<<"What is the weight of the item?(in kg): ";
  14.     cin>>weight;
  15.     cout<<"What is the distance of the journey?(in miles): ";
  16.     cin>>distance;
  17.  
  18.     if((weight<= 0 || weight > 20)||(distance<10 || distance>3000))
  19.         cout<<"Unacceptable weight or distance parameters, please restart the program.";
  20.  
  21.     if(weight<2)
  22.         cost = 1.1 * (weight/500);
  23.     else if (weight >2 && weight <= 6)
  24.         cost = 2.2 * (weight/500);
  25.     else if (weight > 6 && weight <= 10)
  26.         cost = 3.7 * (weight/500);
  27.     else
  28.         cost = 4.8 * (weight/500);
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.     return 0;
  36. }