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
What does your digital footprint say about you? Does your digital footprint
faust18 [17]
Your digital footprint says a lot about you. It represents your difference from everyone else and that you can’t be exactly like someone else. Your digital footprint also shows that there is one part of you that stays true to itself and never changes. It aligns with a purpose for almost everyone. That purpose is to be yourself because no matter how hard you try to be like someone else, something will always remain true to the real you.

Hope this helps. If this isn’t the type of answer you were looking for, I apologize.
7 0
3 years ago
Which of the following is an example of an application software?
pishuonlain [190]
Word processing software
6 0
3 years ago
Explain with a few sentences and using the terms sequencing, selections and loops how they
Sever21 [200]

Answer:

here is your answer

Explanation:

voting is electing people to be ruler

mar me as brainliest

5 0
3 years ago
In some networks, the data link layer handles transmission errors by requesting that damaged frames be retransmitted. If the pro
Usimov [2.4K]

Answer:

The answer with explanation is attached in the file.

Explanation:

Download docx
3 0
3 years ago
Why is iot architecture important?
Harlamova29_29 [7]
They need to make sure your building is easy to move around in. Beyond the building itself, architecture and design can help bring balance to people's lives. ... Well-designed schools create better learning environments. Workplaces with good architecture experience higher productivity.
7 0
3 years ago
Other questions:
  • It takes you 0.8 of a minute to read each page of your health book. It takes you 5.5 minutes to take the test at the end. How lo
    10·2 answers
  • The process of saving files to disk is called.<br> A.read<br> B. Write<br> C. Lock<br> D. Protect
    6·1 answer
  • What is the primary reason that organizations change their structure through downsizing, outsourcing, and offshoring as a means
    14·1 answer
  • colby lives a very career-driven lifestyle. he works long hours and enjoys making a lot of money by working overtime. after he a
    14·2 answers
  • Splunk knows where to break the event, where the time stamp is located and how to automatically create field value pairs using t
    7·1 answer
  • You wish to lift a 12,000 lb stone by a vertical
    7·1 answer
  • The _____ of a local variable is the function in which the variable is created.
    6·1 answer
  • 3. Why is human resource plan made​
    11·1 answer
  • Ndcdeviceid?????????????????????​
    8·1 answer
  • In a relational database application, a(n) ________ key is used to link one table with another.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!