0% found this document useful (0 votes)
7 views1 page

Simple Budget Management System

The document outlines a Python class named 'Budget' that allows users to manage their monthly income, expenses, and savings. It includes methods for setting income, adding expenses, calculating total expenses, calculating savings, and displaying a budget summary. The main function initializes the budgeting system and provides a simple menu for user interaction.

Uploaded by

thadiussherekete
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Simple Budget Management System

The document outlines a Python class named 'Budget' that allows users to manage their monthly income, expenses, and savings. It includes methods for setting income, adding expenses, calculating total expenses, calculating savings, and displaying a budget summary. The main function initializes the budgeting system and provides a simple menu for user interaction.

Uploaded by

thadiussherekete
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

class Budget:

def __init__(self): income = float(input("Enter your monthly income: $"))

[Link] = 0 budget.set_income(income)

[Link] = {}

[Link] = 0 while True:

print("\nOptions:")

def set_income(self, income): print("1. Add Expense")

[Link] = income print("2. Display Budget")

print("3. Exit")

def add_expense(self, category, amount): choice = input("Choose an option: ")

[Link][category] = amount

if choice == "1":

def calculate_total_expenses(self): category = input("Enter expense category (e.g., Rent, Food,


Transportation): ")
return sum([Link]())
amount = float(input("Enter expense amount: $"))

budget.add_expense(category, amount)
def calculate_savings(self):
elif choice == "2":
[Link] = [Link] - self.calculate_total_expenses()
budget.display_budget()
return [Link]
elif choice == "3":

break
def display_budget(self):
else:
print("Budget Summary:")
print("Invalid option. Please choose a valid option.")
print(f"Income: ${[Link]:.2f}")

print("Expenses:")
if __name__ == "__main__":
for category, amount in [Link]():
main()
print(f"- {category}: ${amount:.2f}")

print(f"Total Expenses: ${self.calculate_total_expenses():.2f}")

print(f"Savings: ${self.calculate_savings():.2f}")

def main():

budget = Budget()

print("Budgeting System")

print("----------------")

You might also like