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
Darina [25.2K]
3 years ago
8

Ten potential donors have been asked to contribute today. Create the Python code that calculates the total number of dollars don

ated. Use a for loop to process the donations. Use a while loop to check that the amount contributed is not a negative number. Once the records have been processed, the program prints the total number of dollars donated.

Computers and Technology
1 answer:
kotykmax [81]3 years ago
8 0

Answer:

The code with comments is given below:

# Create a function called process_donations

def process_donations():

   # Initialize the variables total and amount

   total = 0

   amount = 0

   # Create a for loop from 1 to 10 to process each donator

   for i in range(1,11):

       # Print out the donator number

       print("Donator#{}".format(i))

       # Get the amount from user

       amount = int(input("Please enter the amount you're going to donate:"))

       # Use a while loop to check if the amount is greater than 0

       # if not request a valid amount

       while amount <= 0:

           amount = int(input("Enter a valid amount: "))

       # Add the amount to total variable

       total += amount

   # Print the total donated

   print("The total donated is: ${}".format(total))

       

# Create the main function

def main():

   # Call the process_donations

   process_donations()

# When the program is going to run it calls the main function

if __name__ == "__main__":

   main()

Explanation:

Here I've attached a screenshot with the program functionality to show a better approach of the program running.

You might be interested in
The printing press helped spread the ideas of the Renaissance.<br> a. True <br> b. False
guajiro [1.7K]
The answer is a. True

The printing press did help spread the ideas of the Renaissance, as it could spread ideas easily, quickly, and in different languages.

6 0
4 years ago
If you are signed into a Microsoft account and need to sign into another one, click ____ on the list arrow next to Your Name in
torisob [31]

Answer:

left

Explanation:

If you are signed into a Microsoft account and need to sign into another one, click left on the list arrow next to Your Name in the top-right corner of the Word window.

Multiple Microsoft accounts can be opened at one time in different tabs of your computer. They can be used simultaneously as well. It helps the user to work efficiently rather than logging in or logging out from his accounts which hinders effective and efficient output.

5 0
3 years ago
The screened subnet protects the DMZ systems and information from outside threats by providing a network with intermediate secur
maks197457 [2]

Answer:swswsw

Explanation:swwsws

4 0
3 years ago
Which quality should an experiment have to be replicable and valid? O clearly detailed results O a well-cited research paper O s
stiv31 [10]

Answer:a.) clearly detailed results

Explanation:

6 0
3 years ago
State whether True / False:<br>The pause option stops the recording temporarily.*<br>True<br>False​
defon

Answer:

true

Explanation:

when you pause a recording it will temporarily stop but, when you hit record again it will continue where you left off

7 0
3 years ago
Other questions:
  • You have a web application hosted in AWS cloud where the application logs are sent to Amazon CloudWatch. Lately, the web applica
    13·1 answer
  • If Chris has a car liability insurance, what damage would he be covered for
    10·1 answer
  • Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order func
    9·1 answer
  • What are ways to enter formula in Excel? Check all that apply
    8·2 answers
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • Arrange the following units of storage in descending<br> order. B, TB,KB, GB,MB
    5·1 answer
  • What can your employer do to protect you from overhead power lines?
    13·1 answer
  • ________ is a human-computer interaction method whereby inputs to and outputs from a computer-based application are in a convent
    8·1 answer
  • PLZ HELP HELP HELP ME I NEED ANSWER MATH​
    13·2 answers
  • You are the IT administrator for a small corporate network. The network uses a DHCP server for IP address configuration for most
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!