0% found this document useful (0 votes)
24 views

JAVA Project (1)

The document is a project report for a Simple Banking Application developed by students at Guru Nanak Institute of Technology. It details the application's features, classes, methods, and how it operates, emphasizing its educational value in demonstrating Java programming concepts. The report concludes with potential enhancements for future development, such as adding multiple accounts and implementing authentication.

Uploaded by

ROHAN PAL
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

JAVA Project (1)

The document is a project report for a Simple Banking Application developed by students at Guru Nanak Institute of Technology. It details the application's features, classes, methods, and how it operates, emphasizing its educational value in demonstrating Java programming concepts. The report concludes with potential enhancements for future development, such as adding multiple accounts and implementing authentication.

Uploaded by

ROHAN PAL
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

3rd Year (5th Semester) (PR591)

Project Report of

Simple Banking Application

Department of Computer Science and Engineering

By

Rohan Pal (Roll No.500122010164_Reg. No.221430110110)


Bikram Ghosh (Roll No.500122010165_Reg. No. 221430110034)
Aniket Das (Roll No.500122010166_Reg. No. 221430110012)
Adeeb Hussain (Roll No.500122010167_Reg. No. 221430110005)
Smarta Das (Roll No.500122010168_Reg. No. 221430110143)

Under the guidance of


Mrs. Sayani Chandra
Assistant Professor, Dept. of CSE
GURUNANAK INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING

CERTIFICATE

This is to certify that the thesis entitled, “Simple Banking Application”


being submitted by Rohan Pal, Bikram Ghosh, Aniket Das, Adeeb
Husain, Smarta Das, for the award of the degree of Bachelor of
Technology (Computer Science and Engineering) of GNIT, is a record of
bonafide research work carried out by his under supervision and
guidance. Rohan Pal, Bikram Ghosh, Aniket Das, Adeeb Hussain, Smarta
Das have worked for nearly four months on the above project at the
Department of Computer Science and Engineering, Guru Nanak Institute
of Technology, Kolkata and this has reached the standard fulfilling the
requirements and the regulation relating to the degree.
The contents of this thesis, in full or part, have not been submitted to any
other university or institution for the award of any degree or diploma.

Supervisor

----------------------------
Mrs. Sayani Chandra
Assistant Professor
Department of Computer Science and Engineering
GNIT, Kolkata.

Head of the Department

----------------------------------
Head of the Department
Department of Computer Science and Engineering,
GNIT, Kolkata
INDEX

SL.
TOPIC PAGE NO.
NO.

1. OVERVIEW 1

2. FEATURES 1-2

3. CLASSES AND METHODS 2-3

4. HOW IT WORKS 3-4

5. KEY POINTS 4-5

6. CODE 5-8

7. SAMPLE INPUT/OUTPUT 8-9

8. CONCLUSION 9-11
ACKNOWLEDGEMENT
We should like to express our special thanks of gratitude to our professor
Mrs. Sayani Chandra who gave us the golden opportunity to do this
wonderful project Application of “Simple Banking Application’’. Those
who helped us in completing our project. We came to know about so
many new things. We are really thankful to them. Secondly, we would
also like to thank to all project group members for finalizing this project
within the limited time frame.

Rohan Pal

---------------------------
Bikram Ghosh
Date: _______________
Place:_______________ ---------------------------
Aniket Das

---------------------------
Adeeb Hussain

---------------------------
Smarta Das

---------------------------
Simple Banking Application
Overview

T
he Simple Banking Application is a console-based program
designed to simulate basic banking operations in a user-friendly
manner. This application serves as an educational example to
demonstrate core programming concepts, including object-oriented
programming, encapsulation, and method invocation in Java. It allows
users to interact with a virtual bank account by performing fundamental
operations such as:
1. Checking the current account balance.
2. Depositing a specified amount of money into the account.
3. Withdrawing a specified amount of money from the account.
4. Viewing details of the most recent transaction.
5. Exiting the application when operations are complete.
The program is implemented with two main classes: banking, which
contains the main method to initiate the program, and BankAccount,
which encapsulates the account-related functionalities. The application
starts by welcoming the user, displaying their name and account ID, and
presenting a menu of options for interaction. Users can perform
operations repeatedly until they choose to exit. This project is ideal for
demonstrating the practical application of Java programming skills in
real-world scenarios.

Features
1. Check Balance: View the current balance of the account.
2. Deposit Money: Add money to the account balance.
3. Withdraw Money: Deduct money from the account balance.
4. View Previous Transaction: Display the most recent transaction.
5. Exit: Close the application.

Classes and Methods

1. banking Class
 Purpose: Serves as the entry point for the application.
 Key Method:
o main(String[] args): Creates a BankAccount object and
invokes the showMenu() method.
2. BankAccount Class
 Purpose: Contains methods and data to manage a bank account.
 Attributes:
o int balance: Stores the current balance of the account (default:
50000).
o int previousTransaction: Stores the last transaction amount.
Positive for deposits, negative for withdrawals.
o String customerName: Stores the account holder's name.
o String customerId: Stores the account holder's ID.
 Constructor:
o BankAccount(String cname, String cid): Initializes
customerName and customerId.
 Methods:
1. void deposit(int amount):
 Adds the specified amount to the balance.
 Updates the previousTransaction.
2. void withdraw(int amount):
 Deducts the specified amount from the balance.
 Updates the previousTransaction.
3. void getPreviousTransaction():
 Displays the most recent transaction:
 "Deposited: [amount]" for a positive value.
 "Withdraw: [amount]" for a negative value.
 "No transaction occurred" if no transaction exists.
4. void showMenu():
 Displays a menu with banking options.
 Accepts user input for operations:
 Option 1: Check Balance.
 Option 2: Deposit Money.
 Option 3: Withdraw Money.
 Option 4: View Previous Transaction.
 Option 5: Exit.
 Executes corresponding actions using a switch statement.

How It Works
1. The application starts by creating an instance of BankAccount with
the user's name and ID.
2. The showMenu() method is invoked to display a menu of options.
3. The user can select an option by entering the corresponding number.
4. The program performs the selected operation and repeats the menu
until the user chooses to exit.

Key Points

1. Initial Balance:
o The account is initialized with a default balance of 50,000 units.
This ensures that the user has a starting amount to perform
operations like withdrawals and viewing their balance. It also
simplifies testing and demonstration of the application's
features.
2. Error Handling:
o The program gracefully manages invalid inputs by displaying
an error message, such as when a user enters an option outside
the valid range (1-5). This prevents unexpected crashes and
improves user experience by guiding users to provide correct
input.
3. User-Friendly Interface:
o The interactive menu-driven interface is straightforward and
allows users to select operations easily. Each action is clearly
explained, and prompts guide the user through each step of the
process. For example, users are prompted to enter an amount
when performing deposits or withdrawals.
4. Transaction Tracking:
o The previousTransaction attribute keeps track of the most
recent operation, whether it is a deposit or a withdrawal. This
allows users to review their last transaction, promoting
transparency and trust in the system.
5. Encapsulation and Modularity:
o The application employs encapsulation by using the
BankAccount class to manage account-specific data and
methods. This modular approach ensures that the main class
(banking) remains clean and focused on initiating the program,
while the BankAccount class handles the core logic.
6. Extensibility:
o The program is designed in a way that it can be easily extended.
For instance, adding features like interest calculation, multiple
account support, or saving account data to files can be done
without significantly altering the existing structure.

Code:
import java.util.Scanner;

class banking
{

public static void main(String[] args)


{
Scanner sc = new Scanner(System.in);
BankAccount bank1 = new BankAccount("Rohan" , "1050");
bank1.showMenu();
}
}

class BankAccount
{
int balance=50000;
int previousTransaction;
String customerName;
String customerId;

BankAccount(String cname , String cid)


{
customerName = cname;
customerId = cid;
}

void deposit(int amount)


{
if(amount != 0)
{
balance = balance + amount;
previousTransaction = amount;
}
}

void withdraw(int amount)


{
if(amount != 0)
{
balance=balance-amount;
previousTransaction= -amount;
}
}

void getPreviousTransaction()
{
if(previousTransaction > 0 )
{
System.out.println("Deposited : " + previousTransaction);
}
else if(previousTransaction < 0 )
{
System.out.println("withdraw : " + previousTransaction);
}
else
{
System.out.println("no transaction is occured...!");
}
}

void showMenu()
{
char option ='\0';
Scanner sc = new Scanner(System.in);

System.out.println("Welcome " + customerName);


System.out.println("Your customer id is : " + customerId);
System.out.println();
System.out.println("1. Check Balance");
System.out.println("2. Deposit");
System.out.println("3. Withdraw");
System.out.println("4. Previous Transaction");
System.out.println("5. Exit");
do
{
System.out.println("*************************************");
System.out.println("Enter the option : ");
option = sc.next().charAt(0);
Character.toUpperCase(option);

switch(option)
{
case '1' :
System.out.println("*************************************");
System.out.println("Your bank balance is : "+ balance);
System.out.println();
break;

case '2' :
System.out.println("*************************************");
System.out.println("Enter the amount to deposit : ");
int amount = sc.nextInt();
deposit(amount);
System.out.println("*************************************");
System.out.println("After deposit your bank balance is : "+ balance);
break;

case '3' :
System.out.println("*************************************");
System.out.println("Enter the amount to withdraw : ");
int amount2 = sc.nextInt();
withdraw(amount2);
System.out.println("*************************************");
System.out.println("After withdraw your bank balance is : "+ balance);
break;

case '4' :
System.out.println("*************************************");
getPreviousTransaction();
System.out.println();
break;

case '5' :
System.out.println("*************************************");
break;

default :
System.out.println("************Invalid option Please try
again************");
}
}while(option != '5');
}
}
Sample Input/Output

Example 1: Deposit and Check Balance


Welcome Rohan
Your customer id is : 1050

1. Check Balance
2. Deposit
3. Withdraw
4. Previous Transaction
5. Exit

Enter the option:


2
Enter the amount to deposit: 1000
After deposit your bank balance is: 51000

Enter the option:


1
Your bank balance is: 51000

Example 2: Withdraw and View Previous Transaction


Enter the option:
3
Enter the amount to withdraw: 2000
After withdraw your bank balance is: 48000

Enter the option:


4
Withdraw: -2000
Example 3: Invalid Option
Enter the option:
6
************Invalid option Please try again************

Conclusion

T
his banking application demonstrates the use of classes, methods,
and object-oriented programming concepts in Java. By
structuring the program into distinct classes with clear
responsibilities, the code is both modular and easy to understand. The
interactive menu-driven interface enhances the user experience and
allows for repetitive operations until the user decides to exit.
Furthermore, the application highlights practical uses of variables,
control structures, and method invocations, making it an excellent
example for educational purposes.
The program can also be expanded further by incorporating advanced
features such as:
1. Adding multiple accounts with unique IDs.
2. Implementing authentication using passwords or PINs.
3. Including additional transaction types, such as transferring money
between accounts.
4. Integrating file handling to save and retrieve account data for
persistence.
Overall, this application serves as a solid foundation for understanding
basic banking systems and exploring more advanced programming
techniques.

You might also like