Shipping Charges

Please anybody can look at this program and tell me what is the problem that I can't get the validation to work

The Fast Freight Shipping Company charges the following rates:

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

Weight of Package (in kilograms) | Rate Per 500 Miles Shipped

2 Kg 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

Input Validation: Do not accept values of 0 or less for the weight of the package. Do not accept weights of more than 20Kg (this is the maximum weight the company will ship,). Do not accept distances of less than 10 miles or more than 3,000 miles. These are the company’s minimum and maximum shipping distances.

#include <iostream.h>
#include <iomanip>
#include <cstring>
#include <fstream>
#include <utility>
#include <conio.h>
using namespace std;
int main (void)
// Assuming Varibles
double wt_package;
double distance;
double charges;
double rate;

// Asking for inputs.
cout << "Please enter the Wt. Package: ";
cin >> wt_package;
cout << "Please enter the distance: ";
cin >> distance;

// Dertermining the price range.
if (wt_package>0.0 || wt_package<20.0)
// if (wt_package<=0.0){
//cout<< "Please enter the wt. of package above 0.0";
if (wt_package>0.0 && wt_package<2.0){
if (wt_package>2.0 && wt_package<6.0){
if (wt_package>6.0 && wt_package<10.0){
if (wt_package>10.0 && wt_package<20.0){
// if (wt_package>20.0){
// cout<< "Please enter the wt. of package below or equal to 20.0";

// Dertermining the price range.
if (wt_package>10.0 || wt_package<3000.0)

//cout<< "Please enter the distance above 10.0 and below or equal to 3000.0";

if (distance>10.0 && distance<500.0){
if (distance>500.0 && distance<1000.0){
if (distance>1000.0 && distance<1500.0){
if (distance>1500.0 && distance<2000.0){
if (distance>2500.0 && distance<=3000.0){

// calculating
charges = wt_package * rate * distance;

// Displaying the result.
cout << "\nThe charges for shipping is: $" << charges << endl;
cout << endl << endl << endl << "Press Any Key to Continue...";
getch ();
return 0;

Shipping charges problem

guys I am suppose to write a program that asks for the weight of the package and the distance it is to be shipped and then displays the charges. I pretty much got every down except i dont know how to make the program terminate after line 12 if the weight isnt in the right range, terminate after line ...

jQuery ups shipping quotes - sometimes a 5 -10 second delay and timing out

How do you get shipping quotes from ups? Do you ever have issues withups never returning a shipping rate? If so, what did you do toworkaround this? ...

appears 'jQuery in Action' is now shipping

Just thought i'd give a general heads up:I was looking to buy this book late last week and noticed it wasn't instock by Amazon yet (despite the "Feb 7th" publish date), but itappears that it is now in stock and shipping :-) ...

jQuery sell ugg boot,tshirt,handbag,nike shoe,jordan shoe,dunk shoe,puma shoe,and so on for free shipping from

Get Nike Shoes at Super Cheap PricesDiscount Nike air jordans ( Nike Air Max 90 Sneakers ( Nike Air Max 91 Supplier ( Nike Air Max 95 Shoes Supplier ( Nike Air Max 97 Trainers ( Nike Air Max ...

jQuery sell:nike jordan1-24$32,coach okely prada nike DGSunglass $16 /FREE SHIPPING FREE/

========== ========FREE SHIPPING FREE============= HTTP://WWW.ICFSHOP.COM =======FREE SHIPPING FREEAll the products are free shipping, and the the price is enticement ,and also can accept the paypal payment.we can ship within 24 hoursafter your payment.accept the paypalfree sh ...

Simplecart js quantity shipping help please

Ok to start, I am using simplecart js and I am trying to get shipping to work.<script type="text/javascript"> = "";simpleCart.checkoutTo = PayPal;// simpleCart.merchantId = "118575326044237";// simpleCart.checkoutTo = GoogleChec ...

combine shipping based on cart quantity and item name

I am trying to combine shipping across different items in a javascript shopping cart. I can comine shipping based on how many items are in the cart, and characteristics of the item being added. But not both. I need the script to combine shipping based on how many items are in the cart, as well as th ...

Can't combine shipping across items - javascript cart

Right now this javascript shopping cart works to 1. charge shipping based on the item, 2. the destination country, 3. it combines shipping for a quantity over 1 of the SAME item. Each item has 2 different possible shipping charges. I am trying to get the javascript to check the shopping cart to see ...

Good HD deal WD 250GB $130 w/ free shipping

Dell Small Business has a great value on the Western Digital 250GB 8MB Cache 7200 rpm Hard Drive for $250 - 20% instant off - $70 rebate (good through 2/27) = $130 with free shipping ...

I need help adding Shipping to Paypal

Here is what I have:<form target="paypal" action="" method="post" name="myform" onsubmit="CalculateOrder ();"><input type="hidden" name="add" value="1"><input type= ...

Ubuntu shipping

has ubuntu stopped their shipping of free CD/DVD?? is there any chance to get them for free with home delevery????:( ...

Calculating FedEx Charges

I found a code snippet on for retrieving shipping charges from the UPS website. Does anyone know if something similar exists for FedEx? - Beth ...

state field for copying shipping same as billing not working

I am trying to copy the billing information to be the same as the shipping information when they select the checkbox. Everything seems to work except for the State field which is a drop down. Depending on what country they select, the state field will automatically populate.Does anyone know how I ca ...

Calculating Shipping with if/else and function

I am having difficulty getting the following assignment to run properly:Many companies charge a shipping and handling charge for purchases. Create a Web page that allows a user to enter a purchase price into a text box and includes a JavaScript function that calculates shipping and handling. Add fun ...


Does anyone know of any shipping modules besides intershipper that are available? ...

Estimated Shipping Date

I would like to add a "Estimated Ship Date" into a few of my web site pages. We build custom built computers and all pcs from us ship in 9 days. The estimated ship date would be 9 days from the current date that a visitor is on the web site.Is there an easy way to add some html code the th ...

Moving a production database, log shipping?

We are moving a production database from one machine to another.What I was planning to do was to restore the database image to the new machine in advance. Then do a rollforward without STOP... keep it in rf pending until we're absolutely ready. I would then take the production system down, ship all ...

Anyone using "log shipping" method of HA?

I want to implement "log shipping" method as a hot standby. This is not for high availability, but more for disaster recovery.Has anyone set this up? What method are you using to transfer the logs over? Any help with this is much appreciated.-terrence ...

A hint with shipping

Hi. I'll come clean here and admit this is a school assigment. But I've tried really hard to figure this out and all I'm asking for is a hint.What I want to do it multiple the quantity ordered by the kind of shipping selected in my <select> list. I'm pretty sure that what I've got to do is est ...

Laptop battery charges sporadically, got a fix?

I have a problem with my laptop battery not wanting to charge all the time. I have one or two ideas and what to run them by some other folks and get their opinion.Background info:Toshiba Satellite 3005-S304 - (1 GHz machine with XP home installed)I bought the machine new back around 2001. All equipm ...

e-commerce shipping

I'm custom building a shopping cart storefront for a client totally in PHP and I'm looking for a way to estimate shipping costs. I've looked into Tandata's online XML product, ConnectShip, but the monthly fee's a little pricey. Does anyone know of a good OpenSource solution?I found some PHP scripts ...

Paypal html shipping,shipping2 code

In regards to shipping costs I have experimented with "shipping,shipping2". I need help with a variable that will allow my buy now buttons to handle a shipping structure as follows:1 item shipping cost $6.95 2 items shipping cost $7.953 items shipping cost $8.954 items up to 20 items shipp ...



automated shipping label processing program

I would like to know if it would be possible to write an application that would sit on a computer polling an email account. Once the email hits the pc, it runs it through an XML or generic filter that cuts out the crap out of an order receipt to make it in to a nicely formatted shipping label. The l ...

log shipping?

Can you tell me whats log shipping and how to implement?DB2 v8.1.2.89", "OD_14086", "MI00117_14086", and FixPak "9"OS:LINUX 32 BIT ...

jQuery 1 drop down with price + 50.00 shipping and then grand total tried many things cant get it!

1 drop down with price + 50.00 shipping and then grand total tried many things cant get it! $("select").change(function() {    var qty = $(this).val();    var price = $(this).closest("tr")                      ...

Unexpected behavior when using data shipping mode

I have an application that is writing a shared file from 3 different nodes concurrently. Each node writes to different 1MB areas of the file node0 writes block 0, node1 writes block 1, node 2 writes block 2, round robin). When I run this app without data shipping each node just writes it's part of t ...

MySQL log shipping

Does Mysql ( any version ) have the facility of log shipping for disaster recovery? ...

DB2 os/390 -> DB2 Linux/Windows via log shipping or other?

We've got a DB2 v8.x on OS/390 in our organization. It's in another department and they charge us for access. We currently have a script that syncs some tables to a local MS SQL2008 instance. However, we'd like to explore the feasibility of either doing some sort of one-way log shipping or nightly D ...