|
-
October 21st, 2009, 11:26 AM
#5
Re: Program help please!
what does add one for each whole or partial segment of 500 miles mean?
The rate is calculated in increments of 500 miles. Therefore 500 miles is one unit. If the package needs to be shipped 520 miles, then you have to charge them (rate*2) where the rate is determined by the weight. If the distance is 1050.7 miles, you charge (rate*3). The fraction really doesn't matter so it can be dropped or the original distance can be cast into an integer to get rid of it. If distance is 500.7 miles, it sounds like you are supposed to drop the fraction first and charge (rate*1). You'll have to figure out how to read in the data and perform some simple calculations to determine the rate based on weight. then you'll have to calculate the number of distance units and muliply (rate*distanceSegments).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|