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
A new network administrator has been asked to verify the metrics that are used by EIGRP on a Cisco device. Which two EIGRP metri
ICE Princess25 [194]

Answer:

C & E

Explanation:

Metric are parameters used in a dynamic routing protocol to determine a network path. Dynamic routing protocols are protocols configured to a router to enable dynamic learning of network paths in interconnected networks.

There are various types of dynamic routing protocols, they are, RIP, EIGRP, OSPF, IS-IS, BGP etc.

The EIGRP uses various metrics to determine network paths, they are bandwidth, delay, load, Reliability etc.

The reliability and load metrics values are dynamically updated over a period of time, while the bandwidth and delay are static values, but the MTU is not a metric used in EIGRP.

4 0
4 years ago
Why did the boy run from the pillow...... wrong answers only
Savatey [412]

He thinks there is a demon hiding innit thus, he runs and calls his mom. His mom says "Jimmy there's nothing in that pilow young man!" Jimmy walks back to his room scared if its still there. He hops into bed hoping that he can get a good nights rest. The next day, Jimmy asks if he can go buy another pillow. His mom says "As long as it makes you feel safe then ok." Young Jimmy, jumping in excitement, goes to the checkout zone to buy his new pillow. When they get home, Jimmy and his mom eat dinner and then head for bed. Jimmy hops into bed and knows that everything will be ok. The end.

4 0
3 years ago
A thesaurus is an example of a(n)
Ivahew [28]

Answer:

D. online reference

Explanation:

An "online reference" refers to a<em> digital reference</em> that end users may utilize for their work or other daily activities. For example, if a person is looking for the <em>synonym of a particular word,</em> she may then refer to the thesaurus.

A blog is a website where you can find personal journals from different writers.

An e-book is an <em>"electronic book."</em> This allows people to read book digitally.

An e-zine is an<em> "electronic magazine." </em>This is a magazine in its digital form.

3 0
3 years ago
Read 2 more answers
Holly Carpenter argues that technology may actually prevent some kinds of evolution that would benefit humans. Do you agree with
USPshnik [31]

Yes, computers may actually progressively and simply just degenerate and regress humans socially, emotionally, and actually, even physically, because there is not enough face to face interaction and if you are staring at computer all day, no exercise at all.

5 0
3 years ago
Read 2 more answers
Write Python code to save the data to a MongoDB collection:Import json module to parse JSON dataImport MongoClient from pymongo
Zigmanuir [339]

Answer:

Explanation:

The objective of this task is to compute a program that involves the usage of Python code to save the data to MongoDB and to query  the database.

Due to the error that occur which makes me to be unable to submit this answer, I've created a word document instead and the attached file can be found below.

Thanks!

Download docx
8 0
3 years ago
Other questions:
  • When you use the keyboard to scroll to a different position in the document, the ____ automatically moves when you press the des
    6·1 answer
  • Prior to the world wide web as we know it today, the internet was chaotic, without any ____.
    9·1 answer
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • Which of the following are correct? I. Hold the middle mouse button to rotate the model on the screen. II. To pan the model, hol
    15·1 answer
  • Heads or tails
    11·1 answer
  • Which of the following is adoptable in Mindanao only?​
    5·1 answer
  • A user asks for a checkbox to be automatically ticked if the annual revenue field is greater than a million. Which formula to tr
    5·1 answer
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    5·2 answers
  • HELPPPPP!!! Performance Check: Mini-Quiz
    15·1 answer
  • PART 2 - Exercise 2 - Programming Assignment
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!