### Thread: i got tis so far! help me out!

1. No Profile Picture
Junior Member
Devshed Newbie (0 - 499 posts)

Join Date
Sep 2003
Posts
14
Rep Power
0

#### i got tis so far! help me out!

#include <iostream>
using namespace std;

int main()
{
float distance,cost,weight;
cout<<"Weight of Package (in Kg) "<<"Rate Per 500 Miles Shipped"<<endl;
cout<< "what is the distance shipped? ";
cin>> distance;
cout<< "what is the weight of the package? ";
cin >> weight;
if(weight<2)
cout<<"2Kg or less "<<"\$1.10"<<endl;
else if (weight<6)
cout<<"Over 2 Kg but not more than 6 Kg "<<"\$2.20"<<endl;
else if (weight<10)
cout<<"Over 6 Kg but not more than 10 Kg "<<"\$3.70"<<endl;
else if (weight<20)
cout<<"Over 10 Kg but not more than 20 KG "<<"\$4.80"<<endl;
else if (weight<30)
cout <<"dont accept"<<endl;
return 0;
}

help me with this program plz.
Shipping Charges
The Fast Freight Shipping Company charges the following rates:

Weight of Package (in Kg) Rate Per 500 Miles Shipped
2Kg or less \$1.10
Over 2 Kg but not more than 6 Kg \$2.20
Over 6 Kg but not more than 10 Kg \$3.70
Over 10 Kg but not more than 20 KG \$4.80

Write a program that asks for the weight of the package and the distance it is
to be shippped and then displays the charges.

Input validation: do not accept values of 0 or less for the weight of the
package. Do not accept weights of more than 20 Kg. Do not accept distances of
less than 10 miles or more than 3000 miles. These are the company's minimum and
maximum shipping distances.
2. That is not very good code at all. You should use proper formatting, it makes it much more readable. Use proper indentation, etc..

Your boolean expressions are not correct, you should re-do that one.

As a moderator said in your last post, I am not going to do your homework for you. You should re-read the chapter though. I am betting this thread will get closed also...