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 the R in the acronym SMART stand for??
jeyben [28]
Depending on who you ask, it is either Realistic or Relevant. Organizations that can't choose sometimes use the acronym SMARRT.
7 0
4 years ago
Computers can think for themselves<br><br> True<br><br> False
gizmo_the_mogwai [7]

Answer:

false

Explanation:

4 0
3 years ago
Read 2 more answers
Sing hard disk space to temporarily store data or instructions from ram is referred to as the?
Alecsey [184]

Using hard disk space to temporarily store data or instructions from RAM is referred to as <u>virtual memory</u>.

In the field of computers, virtual memory can be described as a method for managing the memory of a system and enabling more space for physical memory. Virtual memory has the advantage of freeing up space so that a shared memory does not need to be used.

Virtual memory causes the stored data in a system to be temporarily get stored in the disk storage from the random access memory (RAM).

The process of virtual memory makes secondary memory seem like a part of the main memory of a system. The amount of storage that can be done by the virtual memory depends on the storage capacity of the secondary memory of a system.

To learn more about virtual memory, click here:

brainly.com/question/13088640

#SPJ4

7 0
2 years ago
A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spe
77julia77 [94]

Answer:

Answer: Program to estimate the power spectral density of the signal

Explanation:

fs= 4000; % Hz sample rate Ts= 1/fs; f0= 500; % Hz sine frequency A= sqrt(2); % V sine amplitude for P= 1 W into 1 ohm. N= 1024; % number of time samples n= 0:N-1; % time index x= A*sin(2*pi*f0*n*Ts) + .1*randn(1,N); % 1 W sinewave + noise

Spectrum in dBW/Hz

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_Hz= 10*log10(pxx); % dBW/Hz

Spectrum in dBW/bin

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_bin= 10*log10(pxx*fs/nfft); % dBW/bin

7 0
3 years ago
What is number system​
schepotkina [342]

<u>★ Defination:</u>

The number system or the numeral system is the system of naming or representing numbers. The number system helps to represent numbers in a small symbol set.

<u>★ Tips:</u>

The value of any digit in a number can be determined by:

• The digit

• Its position in the number

• The base of the number system

<u>★ Types of number system:</u>

There are various types of number system in mathematics. The four most common number system types are:

• Decimal number system (Base- 10)

• Binary number system (Base- 2)

• Octal number system (Base-8)

• Hexadecimal number system (Base- 16)

8 0
3 years ago
Other questions:
  • "a web server that is​ specially-built to manage and deliver business intelligence is called a​ _________."
    7·1 answer
  • Instructions: Type the correct answer in the box. Spell the word correctly.
    5·2 answers
  • Double[][] vals = {{1.1, 1.3, 1.5},
    14·1 answer
  • Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
    5·1 answer
  • What is the difference between a key escrow and a recovery agent? (Choose all that apply.)
    12·1 answer
  • To be a successful computer systems engineer, you must be proficient in programming languages and operating systems. Similarly,
    5·2 answers
  • Select the correct answer.
    6·2 answers
  • Horizontal scaling of a client/server architecture means _____.
    12·1 answer
  • A __________ is a sequence of characters.
    10·1 answer
  • Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!