Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. The program worked before but an unexperienced programmer tried and enhance it and ended up ruining it!!! Before attempting to fix it, you need

image text in transcribed
2. The program worked before but an unexperienced programmer tried and enhance it and ended up ruining it!!! Before attempting to fix it, you need to know what the program was meant to do . See the program description below Description: "The program should allow the user to enter their monthly expenses and should then display the total monthly and yearly expenses based on what was entered". An example of how the program should work is shown below Enter the monthly rent or mortgage amount: 943 Enter the monthly amount spent on car insurance (if applicable): Enter the monthly amount spent on gas or transportation: 167 Enter amount spent on electricity: 230 Enter water bill amount: 120 Enter the monthly amount spent on Groceries: 300 Are there more expenses you would like to add? (y): y Enter the monthly amount spent Extra expenses: 120 Total monthly expense: $1980.00 Total annual expense: $23760.00 Important points to remember: - Notice from the example shown above, the program allows the user to enter addtional expenses if they have any. This is important to remember - Pay attention to the way the totals are displayed in the end, notice there is no space between the dollar sign "$" and the total. below are the program files, notice it uses functions. You can and should fix the functions if needed but you can NOT delete the functions # The showExpenses function accepts mortgage/rent, car insurance (if applicable), # gas or transportation, electric, water, and groceries # arguments and displays the equivalent total expense # information. def showExpenses(house, gas, ,insure, elec, water, grocery, extra) totalMonth = housing + insurance + gas + elec + water + grocery total Year = totalMonth * 12 return totalMonth, totalYear # function displays total monthly and yearly expenses def display (totalMonth, total Year) # Print monthly and annual information. print (' {"Total monthly expense:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

Students also viewed these Programming questions

Question

Compare and Contrast file Systems with database systems?

Answered: 1 week ago