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]
3 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:
Pie3 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
Counter-controlled repetition is also known as:
const2013 [10]

Answer:

a) definite repetition

Explanation:

The counter-controlled repetitions is one in which we know the number of times a loop will be followed or performed.

Definite repetition is the one in which we know the number of iterations to be performed by a loop before the execution of the loop.  

For Example:  

Repeat a loop for 25 times printing out b *.

3 0
3 years ago
Describe how a user would interact with a smart-phone to do various tasks.Consider inputs and outputs.
xz_007 [3.2K]

A smart-phone is also referred to as a mobile device and it can be defined as a small, portable, programmable-electronic device that is designed and developed for sending (transmission) and receiving data (messages) over a network. Thus, a smart-phone must be designed as a hand-held device with communication capabilities.

Basically, the components that make up a smart-phone can be classified into two (2) main categories and these include:

1. <u>Input:</u> it comprises mouthpiece, keyboard, light sensor, etc.

2. <u>Output:</u> it comprises screen, speaker, earpiece, etc.

In this context, an end user would interact with a smart-phone in the following ways to perform (do) various tasks:

  • By using a keyboard to type a text and then sending it to another person.
  • By using a mouthpiece as an input for voice (audio) messages when making call.
  • The screen of a smart-phone displays the necessary information to an end user.
  • When playing a digital music file the speaker produces the output as sound.

Read more on smart-phone here: brainly.com/question/4922532

7 0
3 years ago
Effective communication skills are a desirable workplace skill
OLga [1]
Yes. If there is no effective communication in the workplace then nothing is going to be done.
4 0
3 years ago
(9/5)C+32 write QBASIC expessions for this​
grigory [225]

Answer:

REM PROGRAM TO CONVERT TEMPERATURE IN CELCIUS TO FARENHEIT

CLS

INPUT “ENTER TEMPERATURE IN CELCIUS”; C

F = C * (9 / 5) + 32

PRINT “TEMPERATURE IN FARENHEIT=”; F

END

Explanation:

Your formula suggests a celcius to fahrenheit conversion...

8 0
3 years ago
What is the output of this program?
Charra [1.4K]

Answer:

20

Explanation:

assuming the print statement is not indented, the program effectively calculates 2+5+6+7.

The range(...) is <em>excluding </em>the end value (8 in this case).

3 0
3 years ago
Read 2 more answers
Other questions:
  • That is Entrepreneur ? ?<br>​
    8·1 answer
  • Using the _____ model brings sellers and buyers together on the web and collects commissions on transactions between these parti
    5·1 answer
  • Having a conversation with someone using a cellular phone is an example of _________ transmission. simplex full-duplex half-dupl
    11·1 answer
  • Which of the following Internet protocols is MOST important in reassembling packets and requesting missing packets to form compl
    11·1 answer
  • Betrand Meyer developed the ______ programming language which is not type-safe because it violates the law of contravariance.
    9·1 answer
  • What is the internet ?
    11·2 answers
  • Suppose that f() is a function with a prototype like this: void f(________ head_ptr); // Precondition: head_ptr is a head pointe
    15·1 answer
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    13·1 answer
  • Describe how both IPv4 and IPv6 access and utilize TCP as an upper-layer transfer protocol.
    6·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!