Sunday
December 21, 2014

Homework Help: Computer Science

Posted by Legendirty on Friday, May 10, 2013 at 5:11pm.

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.”

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

progamming concepts - Write a program that allows the user to input a total ...
programming concepts - Write a program that allows the user to input a total ...
programming concepts - Write a program that allows the user to input a total ...
programming - How to work this programming problem- Write a program that allows ...
Computer Science - Write a program   that reads the subtotal and the gratuity ...
computer science - write a program that prompts the user to input three numbers...
computer science - Write a program that prompts the user to input three numbers...
computer science - Write an Assembly program to determine the price of a car ...
computer science - Class scores: Write a program that calculates the total grade...
Computer programming - Sorting is a common operation used in programming. ...

Search
Members