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
Which is a software application used to analyze an organization’s data to improve decision making?
Ostrovityanka [42]

The software application used to analyze an organization’s data to improve decision making is said to be Business intelligence software.

<h3>What is Business intelligence?</h3>

Business intelligence is known to be a kind of app that has been set up and it is known to have a set of data analysis applications that has been made to meet a lot of information needs.

Business intelligence are known to be a kind of procedural and technical input that takes , stores, and analyzes the data made by a company's activities.

Learn more about Business intelligence from

brainly.com/question/13339276

3 0
2 years ago
What is network topology? PLZZZ HURRY
Mashcka [7]

Answer:

Network topology is the arrangement of the elements (links, nodes, etc.) of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and control radio networks, industrial field busses and computer networks.

7 0
3 years ago
Which of the following best describes a balanced reaction
Ghella [55]

Answer:c

Explanation:

just took the test

7 0
2 years ago
Write a program that reads three numbers and print the largest one step by step answer
const2013 [10]

Answer:

CLS

INPUT"Enter any three numbers";a,b,c

IF a>b AND a>c THEN

PRINT a;"is the greatest"

ELSEIF b>a AND b>c THEN

PRINT b;"is the greatest"

ELSE

PRINT c;"is the greatest"

ENDIF

END

6 0
3 years ago
J=2
leonid [27]

Answer:

yup

tthast right

Explanation:

5 0
3 years ago
Other questions:
  • Jack wants to store a large amount of data on his computer. He chooses to use a database for this purpose. What is a database? A
    8·1 answer
  • To clean dirt and spilled electrolyte from a battery, use a dilute solution of either water and baking soda or water and A. sulf
    13·1 answer
  • What contains the computer brain the central processing unit
    8·2 answers
  • Which of the following statements is true?
    8·1 answer
  • To check if your operating system is up to date, click Start then click Control Panel and choose _______________. Select one: a.
    11·1 answer
  • Could someone please explain to me the an electrical circuit.
    13·2 answers
  • Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.
    15·1 answer
  • Huh? translate this please. (jk, I know what it says I just want to test everyone.)
    13·1 answer
  • Disadvantages of computer. ​
    9·1 answer
  • In _____, a program running on a Web server creates a Web page in response to a request for specific information from a Web clie
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!