Question: We'll write a budget planner / calculator for the final project. It will be graded based on correctness. Please check the grading rubrics at the

We'll write a budget planner/calculator for the final project. It will be graded based on correctness. Please check the grading rubrics at the end of the page.
Description
Write a Python program called budgetPlanner.py. The program should calculate a monthly budget for the user based on the expenses of the months the user selected. It should also set aside a sinking fundLinks to an external site. for non-regular expenses.
The records of the previous expenses can be downloaded here: expenses.zipDownload expenses.zip
It contains five text files: jan_expenses.txt, feb_expenses.txt, mar_expenses.txt, apr_expenses.txt, may_expenses.txt
Each line in the file follows the format of item,amount,category -- same as what we had in the spending tracker homework. We will only use the amount and category parts.
Don't forget to unzip the folder and put the five text files in the same folder as your Python program.
Details:
First, your program should ask the user which months' expenses they'd like to use to calculate the budget:
Which months' expenses should be used to plan the budget: jan,feb
Note: Please let the user enter names of the names as shown in the examples, i.e., jan, feb, mar, apr, may. This will make PLAs' grading life easier.The user must enter all the months they want in one input.No need to keep asking if the user wants to calculate another budget.If the user only selects one or zero valid month, your program doesn't need to move forward to calculating the budget. It should print something to let the user know that the data is insufficient to calculate a budget.
Second, your program calculates a monthly budget based on the selected month. Specifically,
For the categories that appear in more than one of the selected months:
We consider them as "regular" spending categories.The monthly budget for these categories is calculated as: its total amount in all the selected months divided by the number of the selected months.For example, if the user selected four months for calculating the budget, and they spent $10, $20, $14 in three of the months. Then the monthly budget for that category is (10+20+14)/4=11.
For the categories that only appear in one of the selected months, regardless of how many times they appear in that month:
We consider them as sinking fundLinks to an external site..Since these categories only appear in one month, it wouldn't make sense to use the average as its budget.So we'll combine all these sinking fund categories and only calculate a budget for the sinking fund.The monthly budget for the sinking fund is calculated as: the total amount of all the sinking fund categories in the selected months divided by the number of theselectedmonths.For example, if the user selected four months, and they spent $100 on personal stuff in only one of the month, $30 on study in only one of the month, then the monthly budget for the entire sinking fund is (100+30)/4=32.5
Finally, print the monthly budget nicely and also which categories belong to the sinking funds. (See example screenshots below for details.)
Note: There is no requirement on what datatype you should use to store the expenses for future calculation. You may use lists or dictionaries. You may also define classes if you want.
Requirements
Organize your code nicely with functions.
No global variables.Define at least three functions, including the main() function.
Do NOT import any modules.
Posting the assignment on online websites e.g. Chegg, or looking up solutions from online sources or AI tools is strictly forbidden.
But of course, you could ask general programming things such as how to write a for loop.
If the user enters an invalid month, simply skip that month and let the user it doesn't exist. Just use the valid months to calculate the budget.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!