Write a program that allows the user to input a total dollar amount for an

online shopping order and computes and outputs the shipping cost based
on the following schedule:
Order Total Ship within USA Ship to Canada
Less than $50.00 $6.00 $8.00
$50.01–$100.00 $9.00 $12.00
$100.01–$150.00 $12.00 $15.00
Over $150.00 Free Free

Sure! Here's a step-by-step guide to writing a program that calculates the shipping cost based on the given schedule:

Step 1: Start by defining the main function of the program.

Step 2: Prompt the user to enter the total dollar amount for their online shopping order.

Step 3: Read and store the user's input.

Step 4: Define variables to represent the shipping costs for within the USA and to Canada for each order total range:

- For orders with a total less than $50.00, set the shipping cost within the USA to $6.00 and to Canada to $8.00.
usa_shipping_cost = 6.00
canada_shipping_cost = 8.00

- For orders with a total between $50.01 and $100.00, set the shipping cost within the USA to $9.00 and to Canada to $12.00.
usa_shipping_cost = 9.00
canada_shipping_cost = 12.00

- For orders with a total between $100.01 and $150.00, set the shipping cost within the USA to $12.00 and to Canada to $15.00.
usa_shipping_cost = 12.00
canada_shipping_cost = 15.00

- For orders with a total over $150.00, set the shipping cost within the USA and to Canada to Free.
usa_shipping_cost = 0.00
canada_shipping_cost = 0.00

Step 5: Use conditional statements to determine the shipping cost based on the user's input:

- If the order total is less than $50.00, assign the value of usa_shipping_cost to shipping_cost.
- If the order total is between $50.01 and $100.00, assign the value of usa_shipping_cost to shipping_cost.
- If the order total is between $100.01 and $150.00, assign the value of usa_shipping_cost to shipping_cost.
- If the order total is over $150.00, assign the value of usa_shipping_cost to shipping_cost.

Step 6: Output the calculated shipping cost to the user.

Here's a Python program that implements the above steps:

```python
def calculate_shipping_cost():
order_total = float(input("Enter the total dollar amount for your order: $"))

usa_shipping_cost = 0.00
canada_shipping_cost = 0.00

if order_total < 50.00:
usa_shipping_cost = 6.00
canada_shipping_cost = 8.00
elif order_total < 100.01:
usa_shipping_cost = 9.00
canada_shipping_cost = 12.00
elif order_total < 150.01:
usa_shipping_cost = 12.00
canada_shipping_cost = 15.00

shipping_cost = usa_shipping_cost if order_total <= 150.00 else 0.00

print("The shipping cost for your order is $", shipping_cost)

calculate_shipping_cost()
```

This program prompts the user to enter the total dollar amount for their order and then calculates and displays the shipping cost based on the provided schedule.

To write a program that calculates the shipping cost based on the provided schedule, you can use a series of if-elif-else statements to check the order total and determine the shipping cost accordingly. Here's an example of how you can implement this program in Python:

```python
def calculate_shipping_cost(order_total, country):
if order_total < 50.00:
if country == "USA":
shipping_cost = 6.00
elif country == "Canada":
shipping_cost = 8.00
elif order_total >= 50.01 and order_total <= 100.00:
if country == "USA":
shipping_cost = 9.00
elif country == "Canada":
shipping_cost = 12.00
elif order_total >= 100.01 and order_total <= 150.00:
if country == "USA":
shipping_cost = 12.00
elif country == "Canada":
shipping_cost = 15.00
else:
shipping_cost = 0.00

return shipping_cost
```

In this program, we define a function called `calculate_shipping_cost` that takes two parameters: `order_total` (the total dollar amount for the online shopping order) and `country` (the destination country, either "USA" or "Canada").

Based on the order total and the country, the program checks the corresponding shipping cost using if-elif-else statements. If none of the conditions match, it means the order total is over $150.00, and the shipping cost is set to 0.00 (free shipping). The function then returns the calculated shipping cost.

You can use this function by calling it with the order total and country as arguments, and it will return the appropriate shipping cost according to the schedule.

here's a little perl program which should do the job. You can probably adapt it to the language of your choice.

my @rates = [
{amount=>150,us=>0,canada=>0},
{amount=>100,us=>12,canada=>15},
{amount=>50,us=>9,canada=>12},
{amount=>0,us=>6,canada=>8}
];

while (1) {
my $amount = <STDIN>;
last unless $amount > 0;
foreach (@rates) {
next unless $amount > $_->{amount};
printf "Order: \$%4.2f\nUS: \$%4.2f\nCanada: \$%4.2f\n",@{$_}{qw(us canada)};
}
}

If you don't know perl, now's your chance to learn it...