1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nadya68 [22]
2 years ago
13

The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or

less. $0.25 Over than 2 kg but not more than 10 kg $0.30 Over 10 kg but not more than 20 kg. $0.45 Over 20 kg, but less than 50kg. $1.75 Write a program that asks for the weight of the package, and the distance to be sent. And then displays the charge.
Computers and Technology
1 answer:
Pie2 years ago
3 0

Answer:

weight = float(input("Enter the weight of the package: "))

distance = float(input("Enter the distance to be sent: "))

weight_charge = 0

if weight <= 2:

   weight_charge = 0.25

elif 2 < weight <= 10:

   weight_charge = 0.3

elif 10 < weight <= 20:

   weight_charge = 0.45

elif 20 < weight <= 50:

   weight_charge = 1.75

if int(distance / 100) == distance / 100:

  d = int(distance / 100)

else:

   d = int(distance / 100) + 1

   

total_charge = d * weight_charge

print("The charge is $", total_charge)

Explanation:

*The code is in Python.

Ask the user to enter the weight and distance

Check the weight to calculate the weight_cost for 100 miles. If it is smaller than or equal to 2, set the weight_charge as 0.25. If it is greater than 2 and smaller than or equal to 10, set the weight_charge as 0.3. If it is greater than 10 and smaller than or equal to 20, set the weight_charge as 0.45. If it is greater than 20 and smaller than or equal to 50, set the weight_charge as 1.75

Since those charges are per 100 miles, you need to consider the distance to find the total_charge. If the int(distance / 100) is equal to (distance / 100), you set the d as int(distance / 100). Otherwise, you set the d as int(distance / 100) + 1. For example, if the distance is 400 miles, you need to multiply the weight_charge by 4, int(400/100) = 4. However, if the distance is 410, you get the int(400/100) = 4, and then add 1 to the d for the extra 10 miles.

Calculate the total_charge, multiply d by weight_charge

Print the total_charge

You might be interested in
A=1/2h(a+b) solve for h
devlian [24]

A=1/2h(a+b)

1/2 can be said as 0.5

so

A=0.5h(a+b)

0.5h is being multiplied with (a+b), taking this expression of left hand side gives

A/0.5(a+b)=h

OR

h=A/0.5(a+b)

This is the final answer

8 0
3 years ago
Which terms means device that converts one voltage to another ?
Jet001 [13]

Answer:

I believe it is an adapter

Explanation:

An adapter or adaptor is a device that converts attributes of one electrical device or system to those of an otherwise incompatible device or system. Some modify power or signal attributes, while others merely adapt the physical form of one connector to another.

6 0
2 years ago
I figured out the secret message in Dad feels good, I can connect the dots
kati45 [8]

Answer:

Nope you figured it out

Explanation:

3 0
3 years ago
Help pls<br> cmu cs 0<br> 4.1.2.1 Creating Groups checkpoint 1
Sindrei [870]

Answer:

Explanation:

Circle(centerX, centerY, radius, fill='black', border=None,

borderWidth=2, opacity=100, rotateAngle=0, dashes=False,

align='center', visible=True)

8 0
2 years ago
Read 2 more answers
You've added a clip art image to your slide. Now you want to add a border. Which tab would you use to make this change?
Vinvika [58]
<span>If you want to add a border you have to use 'Insert' tab to make this change. Then you have to click on</span> "Picture" that is placed in the Insert menu, and choose "Clip Art." You can use the search box at the top of the Clip Art gallery in order to find a suitable border. When you finally found it, click on it, then select the button "Insert".
6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program that accepts any number of homework scores ranging in value from 0 through
    10·1 answer
  • Plz help me of this answer<br><br><br>language:python​
    7·2 answers
  • A forensic investigator at a crime lab is performing a forensic analysis of a hard drive that was brought in by state troopers.
    10·1 answer
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    11·1 answer
  • Eugene wants to indent a paragraph, but the ruler is not present. Which tabs could Eugene use in order to accomplish his goal?
    14·1 answer
  • Find products that satisfy BOTH conditions below:______
    6·1 answer
  • How to simplify???? 2(-3x^2+6x+1)-2(4x^2-3x+1)<br><br>​
    7·1 answer
  • A technician has been dispatched to a customer site to diagnose an issue where the computer turns off intermittently. Upon arriv
    11·1 answer
  • What is media ethics. Explain two forms of maintaining media ethics with examples​
    13·1 answer
  • How many types of window in Qbasic​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!