0% found this document useful (0 votes)
8 views29 pages

Course Project Report Format 1

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)
8 views29 pages

Course Project Report Format 1

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
You are on page 1/ 29

Downloaded by ITB-27

A Course Based Project Report on

DATA BASE APPLICATION IN HTML


Submitted to the

Department of Information Technology

in partial fulfillment of the requirements for the completion of course


JAVA PROGRAMMING LABORATORY(A19PC2IT03)

BACHELOR OF TECHNOLOGY

IN

INFORMATION TECHNOLOGY

Submitted by

M.GEETHIKA 24071A12A1
M.VINOD 24071A12A2
N.SHYAMANTH 24071A12A3
N.SARANYA 24071A12A4
N N.VAMSI KRISHNA 24071A12A5

Under the guidance of


Mrs. Naga
Chandrika (Course
Instructor)
Assistant Professor, Department of IT, VNRVJIET

DEPARTMENT OF INFORMATION TECHNOLOGY

VALLURUPALLI NAGESWARA RAO


VIGNANA JYOTHI INSTITUTE OF
ENGINEERING & TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBA
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet (S.O), Hyderabad – 500 090, TS,
India

Downloaded by ITB-27
VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI
INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade, NBA Accredited for CE, EEE, ME, ECE,
CSE, EIE, IT B. Tech Courses, Approved by AICTE, New Delhi, Affiliated to JNTUH, Recognized as
“College with Potential for Excellence” by UGC, ISO 9001:2015 Certified, QS I GUAGE Diamond Rated
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet(SO), Hyderabad-500090, TS, India

DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE

This is to certify that the project report entitled “Course based Project Title” is a
bonafide work done under our supervision and is being submitted by Mr. Ashok
Kumar Reddy(21071A12B6), Mr. Shree Ram Chandra(21071A12B7), Miss.
Pooja Siri(21071A12B8), Miss. Sri Swapnika(21071A12B9), Miss.
Srinibha(21071A12C0) in partial fulfilment for the award of the degree of Bachelor
of Technology in Information Technology, of the VNRVJIET, Hyderabad during the
academic year 2022-2023.

Mrs. Naga Chandrika Dr D Srinvasa Rao

Assistant Professor Associate Professor & HOD


Department of IT Department of IT

Course based Projects Reviewer

VALLURUPALLI NAGESWARA RAO VIGNANA JYOTHI


INSTITUTE OF ENGINEERING AND TECHNOLOGY
An Autonomous Institute, NAAC Accredited with ‘A++’ Grade,
Vignana Jyothi Nagar, Pragathi Nagar, Nizampet(SO), Hyderabad-500090, TS, India

Downloaded by ITB-27
DEPARTMENT OF INFORMATION TECHNOLOGY

DECLARATION

We declare that the course based project work entitled “EXPENSE TRACKER”
submitted in the Department of Information Technology, Vallurupalli Nageswara
Rao Vignana Jyothi Institute of Engineering and Technology, Hyderabad, in partial
fulfilment of the requirement for the award of the degree of Bachelor of Technology
in Information Technology is a bonafide record of our own work carried out under
the supervision of Mrs. Naga Chandrika, Assistant Professor, Department of IT,
VNRVJIET. Also, we declare that the matter embodied in this thesis has not been
submitted by us in full or in any part thereof for the award of any degree/diploma of
any other institution or university previously.
Place: Hyderabad.

M.GEETHIKA M.VINOD N.SHYAMANTH N.SARANYA


N.VAMSI
KRISHNA
24071A12A1 24071A12A2 24071A12A3 24071A12A4 24071A12A5

Downloaded by ITB-27
ACKNOWLEDGEMENT

We express our deep sense of gratitude to our beloved President, Sri. D. Suresh Babu,
VNR Vignana Jyothi Institute of Engineering & Technology for the valuable
guidance and for permitting us to carry out this project.

With immense pleasure, we record our deep sense of gratitude to our beloved
Principal, Dr. C.D Naidu, for permitting us to carry out this project.

We express our deep sense of gratitude to our beloved Professor Dr. SRINIVASA
RAO DAMMAVALAM, Associate Professor and Head, Department of Information
Technology, VNR Vignana Jyothi Institute of Engineering & Technology,
Hyderabad- 500090 for the valuable guidance and suggestions, keen interest and
through encouragement extended throughout the period of project work.

We take immense pleasure to express our deep sense of gratitude to our beloved
Guide, Mrs. Naga Chandrika, Assistant Professor in Information Technology, VNR
Vignana Jyothi Institute of Engineering & Technology, Hyderabad, for his/her
valuable suggestions and rare insights, for constant source of encouragement and
inspiration throughout my project work.

We express our thanks to all those who contributed for the successful completion of
our project work.

Miss. M.GEETHIKA (24071A12A1)


Mr.M.VINOD (24071A12A2)
Mr.N.SHYAMANTH (24071A12A3)
Miss. N.SARANYA (24071A12A4)

Mr. N.VAMSI KRISHNA (24071A12A5)

Downloaded by ITB-27
ABSTRACT

The Java Expense Tracker project presents a user-centered application designed to

simplify personal finance management. This project aims to streamline expense

recording, categorization, and visualization, enabling users to gain insights into their

spending patterns over time. By incorporating budget-setting capabilities and robust

security measures, the application empowers users to make informed financial

decisions. The user-friendly interface, responsive design, and modular architecture

ensure a seamless experience across various devices. This project seeks to provide

individuals with a valuable tool for achieving financial control and cultivating

responsible spending habits.

Downloaded by ITB-27
TABLE OF CONTENTS

S.NO Section reference Page number


1 Introduction 3-5
2 Source code 6-16
3 Output 17-21
4 Conclusion 22
5 references 22

Downloaded by ITB-27
INTRODUCTION
1.1 PROBLEM DEFINITION

The problem addressed by the Java Expense Tracker project lies in the prevalent
challenge of managing personal finances efficiently and maintaining a clear
understanding of individual spending habits. With the increasingly complex
financial landscape, individuals often find it challenging to keep track of their
expenses, leading to financial disarray, overspending, and inadequate savings.
Traditional methods of expense tracking, such as manual record-keeping, lack the
convenience and accuracy required for effective financial management in today's
fast-paced world. This project aims to provide a comprehensive solution to this
problem by developing a sophisticated Java-based Expense Tracker application.
The core problem entails the absence of a centralized and user-friendly platform
that allows individuals to effortlessly record and categorize their expenses,
analyze spending patterns, and establish viable budgets. The lack of proper data
visualization tools further obstructs users' ability to gain insights into their
financial behavior, hindering their capacity to make informed decisions.
Moreover, security concerns loom large, as financial data is sensitive and must be
protected from unauthorized access.
The inefficiencies in existing expense tracking methods, along with the pressing
need for a reliable and accessible system, drive the motivation for this project. By
creating an advanced Expense Tracker application, the project aims to address
these challenges comprehensively. Through a user-friendly interface, users will be
able to conveniently input their expenses and categorize them, while the
application's data visualization tools will facilitate the understanding of their
spending trends. The integration of budget-setting features empowers users to set
realistic financial goals and encourages prudent financial decision-making.
Enhanced security measures, including robust user authentication and data
encryption, ensure that users' financial information remains confidential and
secure.

Downloaded by ITB-27
1.2OBJECTIVE

1. Understanding the Basics of Web Development and Databases

Learn the fundamentals of HTML, CSS, JavaScript, and relational database concepts like tables and normalization for
web applications.

2. Designing and Building Database-Driven Web Pages

Create interactive web pages using HTML forms that store and manage data in a database through SQL queries.

3. Integrating HTML with Backend Technologies

Connect HTML frontend with backend technologies (PHP, Node.js, Python) to perform database operations (CRUD).

4. Implementing User Authentication and Authorization

Build secure user authentication systems with login, signup, and role-based access control for database-driven apps.

5. Mastering Database Integration Techniques

Integrate relational databases (MySQL, PostgreSQL) into web applications and implement secure data handling practices.

6. Developing Dynamic, Data-Driven Applications

Use JavaScript and AJAX to update web pages dynamically with data fetched from the database without page reloads.

7. Improving Web Application Performance

Optimize database queries and implement caching to enhance the speed and responsiveness of the web application.

8. Understanding Web Security Principles

Apply security measures such as encryption and protection against SQL injection and XSS attacks to safeguard the
application.

9. Developing a Full-Stack Database Application

Build a complete full-stack application by integrating the frontend in HTML with backend processing and database
management.

10. Deploying and Managing Database Applications

Deploy and manage a live database application on a web server, ensuring continuous functionality and security.

11. Reflecting on Real-World Applications and Best Practices

Apply industry best practices to create scalable, maintainable, and efficient database-driven applications for real-world
use

4
Downloaded by ITB-27
12. Implement Data Validation and Error Handling:
Master techniques for validating user inputs in both frontend (HTML/JavaScript) and backend (SQL), and
handling errors gracefully to prevent data corruption and provide a smooth user experience.

13. Learn Session Management and Cookies:


Explore session management techniques using cookies and session variables to persist user data across multiple
pages and maintain user states in web applications.

14. Use Client-Side and Server-Side Frameworks:


Familiarize with popular client-side frameworks (like React or Vue.js) and server-side frameworks (like
Express.js or Flask) to build scalable and maintainable database applications.

15. Integrate Third-Party APIs:


Learn how to integrate third-party APIs with your web applications to extend their functionality, like
incorporating external data or services (payment gateways, social media sharing, etc.).

16. Version Control and Collaborative Development:


Learn to use version control systems like Git to manage project code, collaborate with teams, and maintain code
history and version tracking.

17. Mobile Responsiveness and Accessibility:


Understand the principles of responsive web design to ensure the database application is mobile-friendly, and
implement accessibility features to cater to diverse user needs.

Downloaded by ITB-27
SOURCE CODE
import java.io.*;

import java.util.HashMap;

import java.util.Map;

import java.util.Scanner;

import java.sql.*;

import java.time.LocalDate;

public class pro {

private static final String DB_URL =

"jdbc:mysql://localhost:3306/expenses"; private static final String DB_USER

= "root";

private static final String DB_PASSWORD = "1234567890";

private static Map<String, String> users;

private static Map<String, Map<String, Double>> products;

public static void main(String[] args)

{ users = new HashMap<>();

products = new HashMap<>();

loadUsers();

loadProducts();

Scanner scanner = new Scanner(System.in);

System.out.println("Welcome to the Expense

Calculator!");

while (true) {

Downloaded by ITB-27
6

Downloaded by ITB-27
System.out.println("\nSelect an option:");

System.out.println("1. Login");

System.out.println("2. Signup");

System.out.println("3. Exit");

int choice = scanner.nextInt();

scanner.nextLine(); // Consume newline

switch (choice) {

case 1:

login(scanner);

break;

case 2:

signup(scanner);

break;

case 3:

System.out.println("Exiting...");

saveUsers();

saveProducts();

System.exit(0);

default:

System.out.println("Invalid choice. Please try again.");

private static void login(Scanner scanner)

{ System.out.println("\n--- Login ---");

Downloaded by ITB-27
System.out.print("Username: ");

String username =

scanner.nextLine();

System.out.print("Password: ");

String password = scanner.nextLine();

if (users.containsKey(username) && users.get(username).equals(password)) {

System.out.println("Login

successful!"); showMenu(username,

scanner);

} else {

System.out.println("Invalid username or password. Please try again.");

private static void signup(Scanner scanner) {

System.out.println("\n--- Signup ---");

System.out.print("Enter a username:

"); String username =

scanner.nextLine();

System.out.print("Enter your name: ");

String name = scanner.nextLine();

System.out.print("Enter a password: ");

String password = scanner.nextLine();

if (users.containsKey(username))

{ System.out.println("Username already exists. Please try again.");

} else

{ users.put(username,

password);

Downloaded by ITB-27
products.put(username, new HashMap<>());

saveUsers();

Downloaded by ITB-27
System.out.println("Signup successful! Please log in.");

private static void showMenu(String username, Scanner scanner) {

while (true)

{ System.out.println("\n--- Menu

---"); System.out.println("1. Add

product");

System.out.println("2. View product list");

System.out.println("3. Calculate total cost");

System.out.println("4. Delete product");

System.out.println("5. Change product price");

System.out.println("6. Display customer

details"); System.out.println("7. Logout");

int choice = scanner.nextInt();

scanner.nextLine(); // Consume newline

switch (choice) {

case 1:

addProduct(username, scanner);

break;

case 2:

viewProductList(username);

break;

case 3:

calculateTotalCost(username);

9
Downloaded by ITB-27
break;

case 4:

deleteProduct(username, scanner);

break;

case 5:

changeProductPrice(username, scanner);

break;

case 6:

displayCustomerDetails(username);

break;

case 7:

System.out.println("Logging out...");

saveProducts();

return;

default:

System.out.println("Invalid choice. Please try again.");

private static void addProduct(String username, Scanner scanner) {

System.out.println("\n--- Add Product ---");

System.out.print("Enter product name: ");

String productName = scanner.nextLine();

System.out.print("Enter product price: ");

double productPrice =

scanner.nextDouble();

10
Downloaded by ITB-27
Map<String, Double> customerProducts = products.get(username);

customerProducts.put(productName, productPrice);

saveProducts();

System.out.println("Product added successfully!");

private static void viewProductList(String username) {

System.out.println("\n--- Product List ---");

Map<String, Double> customerProducts = products.get(username);

if (customerProducts.isEmpty())

{ System.out.println("No products added yet.");

} else {

for (Map.Entry<String, Double> entry : customerProducts.entrySet())

{ System.out.println(entry.getKey() + ": $" + entry.getValue());

private static void calculateTotalCost(String username)

{ System.out.println("\n--- Calculate Total Cost

---");

Map<String, Double> customerProducts = products.get(username);

if (customerProducts.isEmpty())

{ System.out.println("No products added yet.");

} else {

double totalCost = 0;

for (double price : customerProducts.values()) {

totalCost += price;

11
Downloaded by ITB-27
}

System.out.println("Total cost: $" + totalCost);

private static void deleteProduct(String username, Scanner scanner)

{ System.out.println("\n--- Delete Product ---");

System.out.print("Enter product name to delete: ");

String productName = scanner.nextLine();

Map<String, Double> customerProducts = products.get(username);

if (customerProducts.containsKey(productName)) {

customerProducts.remove(productName);

saveProducts();

System.out.println("Product deleted successfully!");

} else

{ System.out.println("Product not found.");

private static void changeProductPrice(String username, Scanner scanner)

{ System.out.println("\n--- Change Product Price ---");

System.out.print("Enter product name to change the price: ");

String productName = scanner.nextLine();

Map<String, Double> customerProducts = products.get(username);

if (customerProducts.containsKey(productName)) {

System.out.print("Enter new price: ");

double newPrice = scanner.nextDouble();

12

Downloaded by ITB-27
customerProducts.put(productName, newPrice);

saveProducts();

System.out.println("Price changed successfully!");

} else

{ System.out.println("Product not found.");

private static void displayCustomerDetails(String username)

{ System.out.println("\n--- Customer Details

---"); System.out.println("Username: " +

username);

System.out.println("Name: " + getUsername(username));

private static String getUsername(String username) {

// Extracts the name from the username (e.g., "john123" => "John")

return Character.toUpperCase(username.charAt(0)) +

username.substring(1);

}private static void loadUsers() {

try (Connection conn = DriverManager.getConnection(DB_URL,

DB_USER, DB_PASSWORD);

Statement stmt = conn.createStatement();

ResultSet rs = stmt.executeQuery("SELECT username, password

FROM users")) {

while (rs.next()) {

String username = rs.getString("username");

String password = rs.getString("password");

13
Downloaded by ITB-27
users.put(username, password);

products.put(username, new

HashMap<>());

} catch (SQLException e)

{ System.out.println("Error loading users: " + e.getMessage());

private static void saveUsers() {

try (Connection conn = DriverManager.getConnection(DB_URL,

DB_USER, DB_PASSWORD);

Statement stmt = conn.createStatement()) {

for (Map.Entry<String, String> entry : users.entrySet())

{ String username = entry.getKey();

String password = entry.getValue();

String query = "INSERT INTO users (username, password) VALUES

('" + username + "', '" + password + "') "

"ON DUPLICATE KEY UPDATE password='" + password + "'";

stmt.executeUpdate(query);

} catch (SQLException e)

{ System.out.println("Error saving users: " + e.getMessage());

14
Downloaded by ITB-27
private static void loadProducts() {

try (Connection conn = DriverManager.getConnection(DB_URL,

DB_USER, DB_PASSWORD);

Statement stmt = conn.createStatement();

ResultSet rs = stmt.executeQuery("SELECT username, product_name,

product_price FROM products")) {

while (rs.next()) {

String username = rs.getString("username");

String productName = rs.getString("product_name");

double productPrice = rs.getDouble("product_price");

Map<String, Double> customerProducts = products.get(username);

customerProducts.put(productName, productPrice);

} catch (SQLException e)

{ System.out.println("Error loading products: " + e.getMessage());

private static void saveProducts() {

try (Connection conn = DriverManager.getConnection(DB_URL,

DB_USER, DB_PASSWORD);

Statement stmt = conn.createStatement()) {

for (Map.Entry<String, Map<String, Double>> entry : products.entrySet()) {

String username = entry.getKey();

Map<String, Double> customerProducts = entry.getValue();

15

Downloaded by ITB-27
for (Map.Entry<String, Double> productEntry :

customerProducts.entrySet()) {

String productName = productEntry.getKey();

double productPrice = productEntry.getValue();

// Get the current date

LocalDate currentDate = LocalDate.now();

// Convert LocalDate to java.sql.Date

Date dateOfExpense = Date.valueOf(currentDate);

String query = "INSERT INTO products (username, product_name,

product_price, dateOfExpense) " +

"VALUES ('" + username + "', '" + productName + "', " +

productPrice + ", '" + dateOfExpense + "') " +

"ON DUPLICATE KEY UPDATE product_price=" +

productPrice;

stmt.executeUpdate(query);

} catch (SQLException e)

{ System.out.println("Error saving products: " + e.getMessage());

16

Downloaded by ITB-27
CHAPTER-3

TEST CASES/ OUTPUT

17

Downloaded by ITB-27
18

Downloaded by ITB-27
19

Downloaded by ITB-27
20

Downloaded by ITB-27
21

Downloaded by ITB-27
CHAPTER-4

CONCLUSION
The Java Expense Tracker project successfully addresses the crucial need for
effective personal finance management. Through the development of a user-friendly
and feature-rich application, users are empowered to maintain better control over their
financial health. By providing tools for expense recording, insightful data
visualization, budget tracking, and secure user authentication, the project equips
individuals with the means to make informed decisions about their spending habits.
The responsive user interface ensures accessibility across devices, while modular
design and thorough testing contribute to the application's stability and scalability.
Ultimately, the Expense Tracker project not only offers a practical solution for users
to track their expenses but also fosters financial awareness and responsible financial
practices.

REFERENCES
 https://data-flair.training/blogs/java-expense-tracker/

22

Downloaded by ITB-27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy