Shipping Program (PYTHON CODE) This program should let the user enter any number of items into the program and then calc
Posted: Sat Nov 27, 2021 10:32 am
Shipping Program (PYTHON CODE)
This program should let the user enter any number of items into
the program and then calculate and output the
Subtotal, Tax (if CA), Shipping and Handling, and Total Due.
I used 8 Functions.
MUST DO's
Use at least 4 functions in addition to the Greeting/Welcome (5
Total)
Error Check all User Input. Numbers and State abbreviations and
y/n.
Create and append to a List for user input.
Iterate over list when doing calculations.
Use 0 in quantity to stop entering items.
Ask to run the program again. Yes/No Loop
Format output so Numbers are right aligned.
Sales Tax is only calculated for California.
The Tax Rate is 8%.
salesTax = subTotal * .08
Calculate shipping using the Total Weight of everything.
Shipping is 25 cents per pound.
shippingCost = boxWeight * .25
Handling is a value assignment based on the Total Weight of
everything.
If the Total Weight is less than 10
pounds Handling is 1 dollar.
If the Total Weight is more than 100
pounds Handling is 5 dollars.
If the Total Weight is 10 to 100 pounds
Handling is 3 dollars.
Use an if/elif/else statement to assign a value to the handling
variable.
Shipping and Handling is calculated by adding the shipping cost
to the handling cost.
Your input and output should look like this:
This program lets the user enter products to be shipped and
calculates the
subtotal, tax, shipping and handling, and the grand total due.
Enter two letter abbreviation of the state the package is being
shipped to: ca
Enter quantity (enter 0 if done): 3
Enter weight of Item: 2
Enter cost of Item: 1
Enter quantity (enter 0 if done): 9
Enter weight of Item: 8
Enter cost of Item: 7
Enter quantity (enter 0 if done): 0
Subtotal:
66.00
Tax:
5.28
Shipping and Handling:
22.50
Total Due:
93.78
>>>
This program should let the user enter any number of items into
the program and then calculate and output the
Subtotal, Tax (if CA), Shipping and Handling, and Total Due.
I used 8 Functions.
MUST DO's
Use at least 4 functions in addition to the Greeting/Welcome (5
Total)
Error Check all User Input. Numbers and State abbreviations and
y/n.
Create and append to a List for user input.
Iterate over list when doing calculations.
Use 0 in quantity to stop entering items.
Ask to run the program again. Yes/No Loop
Format output so Numbers are right aligned.
Sales Tax is only calculated for California.
The Tax Rate is 8%.
salesTax = subTotal * .08
Calculate shipping using the Total Weight of everything.
Shipping is 25 cents per pound.
shippingCost = boxWeight * .25
Handling is a value assignment based on the Total Weight of
everything.
If the Total Weight is less than 10
pounds Handling is 1 dollar.
If the Total Weight is more than 100
pounds Handling is 5 dollars.
If the Total Weight is 10 to 100 pounds
Handling is 3 dollars.
Use an if/elif/else statement to assign a value to the handling
variable.
Shipping and Handling is calculated by adding the shipping cost
to the handling cost.
Your input and output should look like this:
This program lets the user enter products to be shipped and
calculates the
subtotal, tax, shipping and handling, and the grand total due.
Enter two letter abbreviation of the state the package is being
shipped to: ca
Enter quantity (enter 0 if done): 3
Enter weight of Item: 2
Enter cost of Item: 1
Enter quantity (enter 0 if done): 9
Enter weight of Item: 8
Enter cost of Item: 7
Enter quantity (enter 0 if done): 0
Subtotal:
66.00
Tax:
5.28
Shipping and Handling:
22.50
Total Due:
93.78
>>>