Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

2. How do they influence my actions?

Answered: 1 week ago

Question

5. If yes, then why?

Answered: 1 week ago