subject

LANGUAGE IS PYTHON!!! PLEASE HELP The Fast Freight Shipping Company charges the following rates:

Weight of Package

Rate per 500 miles Shipped

2 pounds or less

$1.10

Over 2 pounds but not more than 6 pounds

$2.20

Over 6 pounds but not more than 10 pounds

$3.70

Over 10 pounds

$3.80

The shipping charges per 500 miles are not prorated, which means that we don't divide the shipping charges in the above table by 500 to get the shipping charge per mile. For example, if a 2.5-pound package shipped 550 miles, the charges would be $4.40.

Design an algorithm and write a Python program to ask the user to enter the weight of the package, the number of miles shipped, then calculate and display the shipping charges.

Assignment Example:
Weight 1.7 pounds, miles 430 miles, total shipping charges: 1.10
Weight 1.7 pounds, miles 775 miles, total shipping charges: 2.20 ( 1.10 * 2). The key point here is how to get the 2 in the multiplication
Weight 1.7 pounds, miles 1234 miles, total shipping charges: 3.30 (1.10 * 3).
Weight 8 pounds, miles 6290 miles, total shipping charges: 3.70 * 13 = 48.10
Problem Analysis:
2 input: the weight, the miles (both could be decimal values)
Based on the weight, you can use a if-else if decision structure to check which shipping rate you use in the calculation (use the shipping rate in the table)
based on the miles the packages shipped, you calculate how many 500 miles the package is shipped. It determines the number times the shipping rate need to multiple. Sometimes you need to round it up to the next integer, sometime not. You need to figure out when the miles/500 should be rounded up to the next integer, and when it should not.
The program will display the total shipping charges for the package.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
You know the right answer?
LANGUAGE IS PYTHON!!! PLEASE HELP The Fast Freight Shipping Company charges the following rates:
Questions
question
Physics, 13.11.2021 09:00
question
Chemistry, 13.11.2021 09:00
question
Mathematics, 13.11.2021 09:00
question
Mathematics, 13.11.2021 09:00
Questions on the website: 13722362