Question: Develop a program that involves data input, variables, and arithmetic operations. Shipping Charges Program The Fast Freight Shipping Company charges following rates Weight of Packages

Develop a program that involves data input, variables, and arithmetic operations.

Shipping Charges Program

The Fast Freight Shipping Company charges following rates

Weight of Packages (pounds)

Rate per 500 miles Shipped

2 => weight

$1.10

2 < weight <= 6

$2.20

6 < weight <= 10

$3.70

10 < weight <= 20

$4.80

Write a C++ program that asks for the weight of the package and the distance to be shipped. Then, compute the total charge. Charge is computed in 500 mile increments. For example, if the weight of the package is 3 pounds and distance to travel is 680 miles, then the charge will be

$2.20 * 2 = $4.40

You might need to use the ceil() method defined the cmath library for this computation. Definition of ceil() method can be found @

http://www.cplusplus.com/reference/cmath/ceil/

Also, here is an example of its usage

int x=680;

int y = 500;

double range = ceil((static_cast(x)/y);

cout<

Input validation:

Do not accept 0 or less for the weight of the package. If the weight of the package is 0 or less, display the message weight should be a greater than 0

Do not accept more than 20 for the weight of the package. If the weight of the pages more than 20, display the message max weight should 20

Also, do not accept the distances of less than 10 and greater than 3000 (these are the companys min and mx shipping distances)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!