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
what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
Andrews [41]

google does that, and yahoo, and bing. it would be a search engine, or browser.

5 0
3 years ago
What is the number 232 in binary
Gnesinka [82]

Answer:

Step 1: Divide (232)x_{10} successively by 2 until the quotient is 0:

232/2 = 116, remainder is 0

116/2 = 58, remainder is 0

58/2 = 29, remainder is 0

29/2 = 14, remainder is 1

14/2 = 7, remainder is 0

7/2 = 3, remainder is 1

3/2 = 1, remainder is 1

1/2 = 0, remainder is 1

Step 2: Read from the bottom (MSB) to top (LSB) as 11101000.

So, 11101000 is the binary equivalent of decimal number 232

(Answer).

5 0
3 years ago
Read 2 more answers
Which question would you ask when proposing a private cloud?
Ludmilka [50]
I think the answer would be C :)
5 0
3 years ago
Read 2 more answers
8.9 code practice edhesive
nadezda [96]

Answer:

.

Explanation:

7 0
3 years ago
When using the Internet Explorer app, if a page extends below the bottom of the screen, point to the _______ of the screen to di
sertanlavr [38]
When using the Internet Explorer app, if a page extends below the bottom of the screen, point to the "right side" of the screen to display a vertical scroll bar.
5 0
4 years ago
Other questions:
  • What do you think about the argument that word processing reduces the quality of writing?
    11·1 answer
  • What are the two most common form factors used today for computer cases, power supplies, and motherboards?
    15·1 answer
  • 5. Why are female fans particularly valuable to the sports industry? Cite two<br> specific reasons.
    11·1 answer
  • Contextual targeting method mean
    11·1 answer
  • How do computers benefit individuals' health care?
    10·1 answer
  • 13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails".
    11·1 answer
  • Can you move it like this? I can shake it like that
    6·1 answer
  • The science of how an object reacts to its motion through air is called _______________. (12 letters)
    13·2 answers
  • How do you think Beyoncé choreography has/will influence the future of dance?
    9·2 answers
  • what is the name of the program that enables the device and operating system to communicate with each other?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!