Wednesday
March 22, 2017

Post a New Question

Posted by on Thursday, February 16, 2012 at 7:47am.

How to work this programming problem-
Write a program that allows the user to input a total dollar amount for an online shopping order and computers 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

  • programming - , Thursday, February 16, 2012 at 8:07am

    Basically programming is to express what you would do in a programming language.

    This is what I would do if I did it by hand:

    1. Tell me how much the order total
    (example: $88)
    2. Determine the destination
    (example US)
    3. Locate from the table the shipping cost (for US)
    0-50 $6
    50.01-100 $9
    100.01-150 $12
    over 150 free
    Since $88 is within the 50.01 to 100 bracket, the shipping cost (to US) is $9.
    4. Print "Shipping cost to US is $9 for an order of $88"

    What I just wrote is called a pseudocode.
    You will need to adapt this to the programming language of your choice.

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question