Asked by Bettie
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
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
Answers
Answered by
MathMate
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.
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.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.