Tuesday
March 28, 2017

Post a New Question

Posted by on .

Would like to know if this looks right

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
WRITE “Shipping Cost Calculator“
WRITE “This program will calculate the shipping cost of your order.”
DECLARE variable1
DECLARE variable2
DECLARE variable3
Set variable = 0.0
WRITE “How much did your order cost?”
INPUT variable
WRITE “Do you live in the USA (type U) or Canada (type C)?”
INPUT variable
If variable == “U” Then
If variable < 50.00
SET 6.00
Else
If variable < 100 Then
SET 9.00
Else
If variable <= 150 Then
SET 12.00
Else
SET 0.0
End If(150)
End If (100)
End If (50)
WRITE “Your shipping cost is $ “ + variable
Else
If variable == “C” Then
If variable < 50 Then
SET 8.00
Else
If variable < 100 Then
SET 12.00
Else
If variable <= 150 Then
SET 15.00
Else
SET 0.0
End If(150)
End If (100)
End If (50)
WRITE “Your shipping cost is $ “ + variable
Else
WRITE “Sorry, we cannot ship outside the US or Canada.”

  • Computer Science - ,

    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

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question