Question

PYTHON SCRIPT Your parents pay you $3 for each trash bag full of leaves you take....

PYTHON SCRIPT

Your parents pay you $3 for each trash bag full of leaves you take. If you can fill more than 10 bags in a month, they give you a bonus of $20. Write a program that asks the user how many bags of leaves they filled in the past month and prints out the total amount of money they made.
For example, if someone fills 8 bags in a month, they would get $24. But, if they fill 11 bags in a month, they would get 11 x $3 + $20 = $53.
Sample Program Run
How many bags of leaves did you fill this month?
20
Great, you made $80.

Homework Answers

Answer #1

Given below is the code in python:

bags = int(input("How many bags of leaves did you fill this month? : "))

if bags > 10:
money = bags * 3 + 20
  
else:
money = bags * 3

print("Great, you made $", money)

In the above code, we first took bags(int) as an input.

Then we checked if the number of bags is less than or equal to 10.

If it is greater than 10 then if statement is executed, where money = bags * 3 + 20

Else if it is less than 10 then money = bags * 3

Money is printed.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PYTHON SCRIPT Your parents have promised to buy you a game system depending on your grade...
PYTHON SCRIPT Your parents have promised to buy you a game system depending on your grade point average (GPA). If your GPA is in between 3.0 and 3.5, inclusive, then you will get a Wii. If your GPA is greater than 3.5 but less than or equal to 3.8, you will get a Kinect. If your GPA is greater than 3.8, you will get a Playstation 3. Write a program that prompts the user for their GPA and prints out...
1.   You have just received some great news from your parents… they are going to give...
1.   You have just received some great news from your parents… they are going to give your inheritance early, starting now! But, they’re going to force to you make a decision on how you want it. At the end of the day, they are going to give you a total of $500,000. But you have to pick one of the two options for disbursement: Option A: You get it in three lump sum payments as follows: •   You receive $100,000...
Write a Python 3 program called “parse.py” using the template for a Python program that we...
Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file. Name your output file “output.txt”. Build your program using a main function and at least one other function. Give your input and output file names as command line arguments. Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...
In narrative essay format, I want you to address a business/organization case study using multiple concepts...
In narrative essay format, I want you to address a business/organization case study using multiple concepts from class. The case question and case text begin on page 5 of this document. You need to demonstrate their best understanding of management and organizational behavior theory, and the application of those ideas to improve the understanding of various issues. You need to clearly identify at least 3 distinct, substantive issues. For each issue you need to 1), identify evidence from the case...
Chick-fil-A is dominating the U.S. fast-food market. Whereas McDonald’s, Subway, Burger King, and Taco Bell trudge...
Chick-fil-A is dominating the U.S. fast-food market. Whereas McDonald’s, Subway, Burger King, and Taco Bell trudge along at the top of the heap, Chick-fil-A has quietly risen from a South- east regional favorite to become the largest chicken chain and the eighth-largest quick-service food purveyor in the country. The chain sells significantly more food per restaurant than any of its competitors—twice that of Taco Bell or Wendy’s and more than three times what the KFC Colonel fries up. And it...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
read Seasons of Love chapter:measuring a child's life after suicide. please answer the questions : reflect...
read Seasons of Love chapter:measuring a child's life after suicide. please answer the questions : reflect on what happens to the families when there is a suicide in the family, based on the Seasons of Love chapter...how should people be told? What details are best left unshared? below is the story These theories may have a certain face-validity, but they often neglect environmental or contextual factors that are innate to answering the question of “why” a person might engage in...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT