Question: Python 2 With wxPython to make a shipping calculator. The total cost will vary with package weight, shipping speed, and any extras the user might
Python 2
With wxPython to make a shipping calculator. The total cost will vary with package weight, shipping speed, and any extras the user might request. The layout should look something like this.
This is the default state of the interface (first radio of each radio button selected, everything else clear). Nothing has been calculated or else the Clear Form button has just been clicked.
The prices for various weights and shipping speeds are shown. (0 - 1.9 lbs add $5, 2-day air shipping add 10.80, etc.).
Your layout does not have to look exactly like this, but it should contain the widgets shown, and it should be sensible so someone using it can easily tell what is happening when a button is clicked.
You'll need these wxPython widgets.
3 TextCtrl widgets; one for name, one for address, and one for city-state-zip
7 radio buttons total, with a group of 3 for package weight, and a group of 4 for package delivery speed
2 check boxes for selecting options
2 buttons, one to trigger calculating the total, the other to reset the form in its default position.
a number of StaticText widgets to make sure everything is labeled clearly
a label at the bottom of the frame where the results will be printed. Since the form has been cleared in the image above you cannot see the summary label until something is actually calculated. (see the image later on this page)
Please start early in the week that this program is due; this gives you plenty of time to ponder how is should work. Moreover, there will be more to ponder as the course progresses. I am glad to help troubleshoot programs, but I go to bed reasonably early and am unlikely to stay up until midnight of the due date.
Shown next is an example calculation for a gift-wrapped 3 lb. package shipped 3-day air. Note the 4-line summary printed at the bottom of the form which includes the content of all three TextCtrl widgets plus the calculated total shipping cost. This summary was printed in a single StaticText widget designated for displaying the results when the Calculate Total button was clicked.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
