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
Why do relational databases use primary keys and foreign keys?.
Andrew [12]

Answer:

Explanation:

A relational database is designed to enforce the uniqueness of primary keys by allowing only one row with a given primary key value in a table. A foreign key is a column or a set of columns in a table whose values correspond to the values of the primary key in another table.

8 0
2 years ago
People are starting to type in whole questions rather than specific words, which leads credence to having _____ that have this a
SpyIntel [72]

Answer:

a. corporate blogs

Explanation:

corporate blog is the practice of creating content that addresses various topics which includes (updates, expert tips or best practices and company news) from the perspective of a brand. Also, blogs make posts and comments easy to reach and follow.

4 0
3 years ago
In which of the following phases of filmmaking would a production team be focused on the process of casting?
Rzqust [24]

Explanation:

There are five phases of film production and they include development, pre-production, production, post-production and distribution.

3 0
2 years ago
Read 2 more answers
After a conditional formatting rule is created using the ____ dialog box, the rule is then available for use in the database fro
Setler [38]

Answer:

New Formatting Rule.

Explanation:

Using New Formatting Rule the rule can be used in the database .Conditional formatting is used to highlight cells with different color according to the value of the cell. Conditional formatting can be done using formulas.In conditional formatting you can use if statements ,if else staements ,formulas etc.

5 0
3 years ago
You are going to visit a national park, and have never been there before. You are using a map to try and make the distance trave
Firdavs [7]

Answer:

eggs fishing didn't ysjffj

8 0
3 years ago
Other questions:
  • Does time complexity depend on, which base arithmetic you use? like base 10, 2 or whatever else? Does time coplexity depned on t
    13·1 answer
  • Interior gateway protocols are used by routers in order to share information within a single
    9·1 answer
  • What is the rarest Supercar/hypercar you have ever seen?
    7·1 answer
  • Suppose barriers to entry exist in the telecommunications industry. This best describes a _____ market.
    12·1 answer
  • Which of the following is not a hazard a driver might encounter?
    5·1 answer
  • What is boolean rules​
    12·1 answer
  • Add the following method to the Point class: public double distance(Point other) Returns the distance between the current Point
    12·1 answer
  • What is a trojan horse
    8·2 answers
  • Microsoft recommends when that you create passwords with upper and lowercase letters, numbers, symbols, and use at least _______
    5·1 answer
  • Jobs that use math and science to solve problems involving the design and development of technologies can be found in the what c
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!