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
Romashka [77]
3 years ago
7

2. In many jurisdictions a small deposit is added to containers to encourage people to recycle them. In one particular jurisdict

ion, containers holding one litre or less have a $0.10 deposit, and containers holding more than one litre have a $0.25 deposit. Write a Python script that reads the number of containers of each size from the user. The script should compute and display the refund that will be received for returning those containers. Format the output so that it includes a dollar sign and displays exactly two decimal places.

Computers and Technology
1 answer:
RUDIKE [14]3 years ago
5 0

Answer:

Here is the Python program:

small_container = int(input("Enter the number of small containers you recycled?"))

large_container = int(input("Enter the number of large containers you recycled?"))

refund = (small_container * 0.10) + (large_container * 0.25)

print("The total refund for returning the containers is $" + "{0:.2f}".format(float(refund)))

Explanation:

The program first prompts the user to enter the number of small containers. The input value is stored in an integer type variable small_container. The input is basically an integer value.

The program then prompts the user to enter the number of large containers. The input value is stored in an integer type variable large_container. The input is basically an integer value.

refund = (small_container * 0.10) + (large_container * 0.25)  This statement computers the refund that will be recieved for returning the small and larger containers. The small containers holding one litre or less have a $0.10 deposit so the number of small containers is multiplied by 0.10. The large containers holding more than one litre have a $0.25 deposit so the number of large containers is multiplied by 0.25. Now both of these calculated deposits of containers of each side are added to return the refund that will be received for returning these containers. This whole computation is stored in refund variable.

print("The total refund for returning the containers is $" + "{0:.2f}".format(float(refund))) This print statement displays the refund in the format given in the question. The output includes a $ sign and displays exactly two decimal places by using {0:.2f} where .2f means 2 decimal places after the decimal point. Then the output is represented in floating point number using. format(float) is used to specify the output type as float to display a floating point refund value up to 2 decimal places.

You might be interested in
Which of the following is a correct definition of the term rectification? A. Rectification is the opposition to current flow in
AlekseyPX
Rectification is "C. The conversation of an AC current to a DC current
5 0
3 years ago
Read 2 more answers
What is the correct name for the words Home, Insert, Design, Layout, References, etc. in the ribbon in Word 2016?
KIM [24]

Answer:

Option (B) i.e.,Tabs is the correct option.

Explanation:

Because the followings are the tabs in the ribbon of Ms Word 2016, with the help of the tabs we can edit, update, modify, design, change or insert layout and also we can insert themes, etc in our document. These tabs are important to create our document attractive and provide good designs in the document. We also create business cards, invitation card and other important things with the help of tabs.

7 0
3 years ago
Read 2 more answers
is this statement true or false ? satelite and remote sensing devices have helped cartographers make more accurate maps with spe
Genrish500 [490]

Answer:

Yes this statement is true

Explanation:

Satelites help show a visual to cartographers to make more accurate maps easier.

3 0
3 years ago
C++
Lilit [14]
The awnser is task 6 because 6 plus 8 is 20 and that equals for 6 gallons to go the the teen choice awards
7 0
3 years ago
Conceptos importantes de red de computadoras
Bumek [7]

Answer:

-Consiste en conectar varias redes de computadoras basadas en diferentes protocolos -Requiere la definición de un protocolo de interconexión común sobre los protocolos locales. -El Protocolo de Internet (IP) desempeña este papel, definiendo direcciones únicas para una red y una máquina host.

3 0
3 years ago
Other questions:
  • You're working at a large industrial plant and notice a tag similar to the one shown in the figure above. Which of the following
    5·1 answer
  • what is the software that controls the storage, retrieval and manipulation of database stored in a database
    14·1 answer
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • What internet service provider first dominated the internet in the 1990s?
    15·1 answer
  • Which procedure is used as a physical barrier to secure data against unauthorized access in a cloud storage data center?
    6·1 answer
  • Where do you place the logical test argument in an JF function formula?
    5·2 answers
  • Help! I’ll mark you brainly! Please help me.
    15·1 answer
  • The success criteria are used to judge whether a project is successful. False True <br> need it now
    13·2 answers
  • A computer's capability of distinguishing spoken words is called?
    9·1 answer
  • THIS IS TIMED PLS HURRY UP
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!