Question: Write a Python program using a multi-way decision structure that calculates the total cost of an order including shipping. Use the following table to calculate
Write a Python program using a multi-way decision structure that calculates the total cost of an order including shipping. Use the following table to calculate shipping cost: Program Input What is the cost of the items that you ordered? - If the user enters a number that's less than zero, display an error message and give the user a chance to enter the number again. - You can assume that the user enters a valid input, no error checking is needed. Program Output Your shipping cost is: $YY.YY (Replace YY.YY with shipping cost; display 0 if it is free) Your total cost including shipping is: $27.2Z - Replace ZZ.ZZ with the calculated total cost; display the output to 2 decimal places Test Case 1: Let's calculate the total cost of your order! What is the cost of items ordered (\$): 49.99 Your shipping cost is: $7.95 Your total cost including shipping is: \$57.94 Test Case 2: Let's calculate the total cost of your order! What is the cost of items ordered(\$): -65.50 You must enter a positive number. Please try again. What is the cost of items ordered(\$): 65.50 Your shipping cost is: $9.95 Your total cost including shipping is: $75.45
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
