✅ Key Features
Attributes:
- desc: Stores the description of the expense.
- amount: Stores the amount spent on the expense.
Methods:
Getters and Setters:
getDesc()
and setDesc(String d)
: Access and modify the description of the expense.
getAmount()
and setAmount(double a)
: Access and modify the amount of the expense.
🔗 Usage
- The Expense class is used in the Budget class to represent individual spending items within a budget.
- Each Expense object is added to the LinkedList of expenses in a Budget.
💡 Example
- An Expense object can be created with a description (e.g., "Groceries") and an amount (e.g., 50.0).
- It can then be added to a Budget to track spending.