Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: Shipping Charges The Fast Freight Shipping Company charges the following rates: Weight of Package Rate per 500 miles Shipped 2 pounds or less $1.10

Question: Shipping Charges

The Fast Freight Shipping Company charges the following rates:

Weight of Package

Rate per 500 miles Shipped

2 pounds or less

$1.10

Over 2 pounds but not more than 6 pounds

$2.20

Over 6 pounds but not more than 10 pounds

$3.70

Over 10 pounds

$3.80

The shipping charges per 500 miles are not prorated. For example, if a 2.5-pound package shipped 550 miles, the charges would be $4.40.

Write a program to ask the weight of the package, the number of miles shipped, then calculate and display the shipping charges.

For example:

Weight 1.7 pounds, miles 430 miles, charges: 1.10

Weight 1.7 pounds, miles 775 miles, charges: 2.20 ( 1.10 * 2). The key point here is how to get the 2 in the multiplication

Weight 1.7 pounds, miles 1234 miles, charges: 3.30 (1.10 * 3).

Weight 8 pounds, miles 6290 miles, charges: 3.70 * 13 = 39.10

Problem analysis:

2 input: the weight, the miles

Weight: double, miles: double

Based on the weight, you check which shipping rate you use in the calculation

You can use a if-else if to check the weight

You also need to figure out how many 500 miles the shipping distance has. Sometimes you need to round it up to the next integer, sometime not.

Requirements: pseudocode and flowchart

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: 3

blur-text-image

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions