CSS Report
CSS Report
Micro Project On
“Expense Tracker”
Submitted By
Under Guidance of
Mrs. J. C. Joshi
Sinhgad Institutes
Sinhgad Technical Education Society’s
SOU. VENUTAI CHAVAN POLYTECHNIC, PUNE - 411041
ACADEMIC YEAR 2024 -2025
Maharashtra State Board of technical
Education Certificate
This is to certify that Ms. Janhavi Amit Shinde with Roll No. 50
of Fifth Semester of Diploma in Information Technology of
Institute Sou. Venutai Chavan Polytechnic (Code:0040) has
successfully completed the Micro-Project in Client Side
Scripting Language (22519) for the academic year 2024- 2025.
A. BRIEF INTRODUCTION:
This project is a basic Expense Tracker web application that enables users to add, edit, delete, and filter
their daily expenses. It includes a form to input expense details (name, amount, category, and date) with
built-in validation to ensure correct data. Submitted expenses are displayed in a table, and users can filter
expenses by category or view the total amount spent. The app uses JavaScript to handle form submission,
data manipulation, and user interactions, providing a simple yet functional tool for managing expenses.
D. RESOURCES REQUIRED:
Name of Resource
Sr . No. Specification
Required
1 Laptop Intel (R) Core i5- 8GB RAM
2 Operating system Windows 11
3 Software Notepad
ACTION PLAN:
GROUP MEMBERS:
S. No Course Outcomes
CODE:
document.addEventListener("DOMContentLoaded", () => {
const expenseForm = document.getElementById("expense-form"),
expenseList = document.getElementById("expense-list"),
totalAmount = document.getElementById("total-amount"),
filterCategory = document.getElementById("filter-category");
let expenses = [];
expenseForm.addEventListener("submit", (e) => {
e.preventDefault();
const name = document.getElementById("expense-name").value,
amount = parseFloat(document.getElementById("expense-amount").value),
category = document.getElementById("expense-category").value,
date = document.getElementById("expense-date").value;
// Validation
const currentDate = new Date(),
enteredDate = new Date(date);
if (!name) return alert("Please enter an expense name.");
if (isNaN(amount) || amount <= 0) return alert("Please enter a valid amount greater than 0.");
if (!category) return alert("Please select a category.");
if (!date || enteredDate > currentDate) return alert("Please select a valid date (up to today's date).");
const expense = { id: Date.now(), name, amount, category, date };
expenses.push(expense);
displayExpenses(expenses);
updateTotalAmount(expenses);
expenseForm.reset();
});
filterCategory.addEventListener("change", (e) => {
const category = e.target.value;
const filteredExpenses = category === "All" ? expenses : expenses.filter(expense =>
expense.category === category);
displayExpenses(filteredExpenses);
updateTotalAmount(filteredExpenses);
});
function displayExpenses(expenses) {
expenseList.innerHTML = "";
expenses.forEach(expense => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${expense.name}</td>
<td>₹${expense.amount.toFixed(2)}</td>
<td>${expense.category}</td>
<td>${expense.date}</td>
<td>
<button class="edit-btn" data-id="${expense.id}" style="color: #ffd700;"> Edit</button>
<button class="delete-btn" data-id="${expense.id}" style="color: #e74c3c;"> Delete</button>
</td>
`;
expenseList.appendChild(row);
function updateTotalAmount(expenses) {
const total = expenses.reduce((sum, expense) => sum + expense.amount, 0);
totalAmount.textContent = total.toFixed(2);
}
});
OUTPUT:
Original Website:
The Expense Tracker project successfully demonstrates the integration of JavaScript for interactive web
functionality, enabling users to efficiently manage and monitor their expenses. Through the
implementation of features such as real-time data entry, category filtering, and validation, the application
enhances user experience by providing an intuitive interface. The use of arrays and event-driven
programming ensures that expenses are tracked effectively, while functions simplify data manipulation.
This project not only showcases practical programming skills but also emphasizes the importance of
financial management in daily life, encouraging users to be more mindful of their spending habits.
References:
1. https://www.w3schools.com/js/
2. https://exploringjs.com/
3. https://www.geeksforgeeks.org/javascript/