Question: Write a program called spendingTracker.py to simulate a spending and income tracker. Details The expenses and incomes are saved in a text file expenses.txt .
Write a program called spendingTracker.py to simulate a spending and income tracker.
Details
The expenses and incomes are saved in a text file expenses.txtzip Download expenses.txtzip. You'll need to unzip the file after download. In the file, each line is of the format specification,amount,category. There is an extra empty line at the end of the file.
Your program should keep asking the user to choose an operation until they enter "done":
summarize: If the user chooses summarize, your program should print the summary data, including the total income, the expenses of each category, the total expense, and the remaining balance.
The summary data should be up to date. If the user chooses the add operation and adds new entries, then the summary data should include the results from the new entries.
add: If the user chooses add, your program should ask the user for the information of the new entry.
The user may add any entry, as long as it follows the correct format. That means, they could add an income entry or an entry with a new category.
done: If the user chooses done, your program should write the new entries to expenses.txt and then terminate.
The original entries in expenses.txt should still remain in the file.The new entries should also follow the format specification,amount,category.
Note:
Although the assignment is graded based on effort, but try to handle as many invalid user inputs as you could think of
Youmust use dictionaries for this homework. Think about what information is needed and what should be the key, and what should be the value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
