Question

The following program contains a logical error. Fix it. # Trust Fund Buddy - Bad #...

The following program contains a logical error. Fix it.

# Trust Fund Buddy - Bad
# Demonstrates a logical error

print(
"""
Trust Fund Buddy

Totals your monthly spending so that your trust fund doesn't run out
(and you're forced to get a real job).

Please enter the requested, monthly costs. Since you're rich, ignore pennies
and use only dollar amounts.

"""
)

car = input("Lamborghini Tune-Ups: ")
rent = input("Manhattan Apartment: ")
jet = input("Private Jet Rental: ")
gifts = input("Gifts: ")
food = input("Dining Out: ")
staff = input("Staff (butlers, chef, driver, assistant): ")
guru = input("Personal Guru and Coach: ")
games = input("Computer Games: ")

total = car + rent + jet + gifts + food + staff + guru + games

print("\nGrand Total:", total)

input("\n\nPress the enter key to exit.")

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# Trust Fund Buddy - Bad

# Demonstrates a logical error

print(

"""

Trust Fund Buddy

Totals your monthly spending so that your trust fund doesn't run out

(and you're forced to get a real job).

Please enter the requested, monthly costs. Since you're rich, ignore pennies

and use only dollar amounts.

"""

)

car = input("Lamborghini Tune-Ups: ")

rent = input("Manhattan Apartment: ")

jet = input("Private Jet Rental: ")

gifts = input("Gifts: ")

food = input("Dining Out: ")

staff = input("Staff (butlers, chef, driver, assistant): ")

guru = input("Personal Guru and Coach: ")

games = input("Computer Games: ")

#here we need to convert all of them into integers and add them

#if we add directly it will concatnate all the strings

total = int(car) + int(rent) + int(jet) + int(gifts) + int(food )+ int(staff) + int(guru) + int(games)

print("\nGrand Total:", total)

input("\n\nPress the enter key to exit.")


Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
The following program contains a logical error. Fix it. # Trust Fund Buddy - Bad #...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • help # 3. The following program contains a logical error. Fix it. # Trust Fund Buddy...

    help # 3. The following program contains a logical error. Fix it. # Trust Fund Buddy - Bad # Demonstrates a logical error print II II II Trust Fund Buddy Totals your monthly spending so that your trust fund doesn't run out (and you're forced to get a real job). Since you're rich, ignore pennies Please enter the requested, monthly costs. and use only dollar amounts. car = input("Lamborghini Tune-Ups: ") rent = input("Manhattan Apartment: ") jet = input("Private Jet...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT