Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USA USA Here are the BamaZon Shipping rates for small and medium packages to be delivered to USA or Canada : Small Canada Up to

image text in transcribed
USA USA Here are the BamaZon Shipping rates for small and medium packages to be delivered to USA or Canada : Small Canada Up to 40 g $4.25 $2.27 Over 40 g up to 70 g $5.27 $2.40 Medium Canada Up to 50 g $2.80 $4.12 Over 50 g up to 100 g $4.29 $6.45 Over 100 g up to 2008 $6.35 Over 200 g up to 3008 $8.98 $15.90 Over 300 g up to 6008 $10.35 Your program will ask the user for three pieces of information (destination, size and weight) and then output the postage rate. The user must enter a valid country, either "Canada" or "USA" for the destination country. Any other input will be considered an error. The user should be asked if the package is small or medium and then they should be prompted for the weight which must be between 0 and 600 grams for a medium package, or less than 70 grams for a small package. If the user enters a weight over 70 grams for a small package, change the size to medium, inform the user and continue with your calculations. NOTES . You can assume that the user will enter numbers when prompted for a numbers. It is OK for your program to crash if the user does not enter a number when they are supposed to . You must check to make sure that values entered by the users are within a legal range. If they are not, display a message to the user and exit the program by using exito. Display your dollar amounts properly formatted as a dollar amount with 2 decimal places displayed. For example, $1.20, not $1.2. . Your program should be properly commented with a header at the top indicating what the program does and a few short comments in the body of your program to help to explain what it is doing. . You should not be doing more comparisons than necessary. Think about using nested if statements and elif statements to simplify your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions