Income, Expenditure and Savings Tracker

M · mediumP · Verified PYQ

Write a program that continuously takes user input: - Income (amount earned) - Type of Material (category of expenditure) - Expenditure on that Material (amount spent) The input continues until the user enters “done”. Then display: 1. Total income 2. Total savings (Income - Total Expenditure) 3. List of where money was spent with respective amounts

Input
5000
Food
1200
Rent
2000
done
Output
Total Income: 5000
Total Savings: 1800
Food: 1200
Rent: 2000
Use a dictionary to track expenditure categories. Sum all expenditures for savings calculation.
← GCD of Two NumbersInsertion Sort →
Report an issue with this question