0% found this document useful (0 votes)
38 views23 pages

SodaPDF Converted Project - 10

1) The document is a student project on creating a basic banking application in Java. It includes details of the student, the programming language used, and categories of the project. 2) The program allows users to perform basic banking tasks like opening new accounts, depositing and withdrawing money, checking balances, and viewing all accounts. It uses classes like Account and Bank to manage accounts. 3) The student acknowledges help from their computer teacher and expresses gratitude for learning more about Java programming through completing this project.

Uploaded by

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

SodaPDF Converted Project - 10

1) The document is a student project on creating a basic banking application in Java. It includes details of the student, the programming language used, and categories of the project. 2) The program allows users to perform basic banking tasks like opening new accounts, depositing and withdrawing money, checking balances, and viewing all accounts. It uses classes like Account and Bank to manage accounts. 3) The student acknowledges help from their computer teacher and expresses gratitude for learning more about Java programming through completing this project.

Uploaded by

wrw wfgwgw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

PROFILE

Don Bosco English Medium


School
Name Mahfuj Alam

Class IX-A

Roll No -13

COMPUTER PROJECT
JAVA PROMMING LANGUAGE

J-Just

A-Another

V-Virtual

A-Acceletor
PROJECT CATEGORY
Internal Assessment java project a
programming environment social category is
assigned to an investment project after
appraisal and before public disclosure during
create different type of console application
project. This project require a minimum 5 days
disclosure period. INTERNAL ESSESSMENT
JAVA project expected to have significant
adverse use own computer. This project to
create using BLUEJ , NOTPAD and MS WORD.
This project base console application,. This
console program you can easy to use and see
the output.
ACKNOWLEDGEMENT
I, Mahfuj Alam reading in class ix of Don Bosco eng med
school want to express my special thanks of gratitude to my
computer teacher Mr.Soumitra Kalidaha who gave us this
golden opportunity to do this project on java. I would also like
to thank our respected principal Fr.Yaccub Ekka .My parents
and once again Soumitra sir with whose able guidance I am
able to complete this project on java
PROGRAM STATEMENT

Create a java program which creates menu for users


to choose from the following:

Choose 1: Open New Account


Choose 2: Deposit Amount
Choose 3: Withdraw Ammount
Choose 4: Check balance
Choose 5: List all Accounts

Choose 6: Exit.

PROGRAM
ACCOUNT.JAVA-

public class Account

private long acNo;

private String acHolderName;

private char actype;

private double acBal;

public Account(long no,String name, char type, double bal)

acNo=no;

acHolderName=name;

actype=type;

acBal=bal;

public long getAcNo()

return acNo;

public String getAcHolder()

return acHolderName;
}

public char getAcType()

return actype;

public double getAcBal()

return acBal;

public void deposit(double amt)

acBal+=amt;

public boolean withdraw(double amt)

if(acBal<amt)

return false;

acBal-=amt;

return true;

public void displayAcDetails()


{

System.out.println("Account No. : "+acNo);

System.out.println("Account Holder Name : "+acHolderName);

System.out.println("Type of Account : "+actype);

System.out.println("Balnance Amount : "+acBal);

}
BANK.JAVA-

import java.util.*;

public class Bank

private final int TOTAL_ACCPT_LIMIT=10;

private Account[] accts;;

private int acCount;;

public Bank()

accts=new Account[TOTAL_ACCPT_LIMIT];

acCount=0;

private Account getAccount(long accNo)

Account acct=null;

for(int i=0;i<acCount;i++)

if(accts[i].getAcNo()==accNo)

break;

return acct;
}

public void openAccount()

if(acCount==TOTAL_ACCPT_LIMIT)

System.out.println("Limit reached, can't create more than


"+TOTAL_ACCPT_LIMIT+"accounts");

Scanner cr=new Scanner(System.in);

System.out.println("Enter Account Number: ");

long acNum=cr.nextLong();

cr.nextLine();

System.out.println("Enter Account Holder Number: ");

String name=cr.nextLine();

System.out.println("Enter Account Type(Saving(S)/Current(C): ");

char type=cr.next().charAt(0);

System.out.println("Enter Account Balance: ");

double bal=cr.nextDouble();

accts[acCount++]=new Account(acNum,name,type,bal);

System.out.println("Acccount Opened Successfully\n");

}
public void balanceEnquiry()

Scanner cr=new Scanner(System.in);

System.out.println("Enter Account Number: ");

long acNum=cr.nextLong();

Account acct=getAccount(acNum);

if(acct==null)

System.out.println("Sorry,Account not found\n");

else

acct.displayAcDetails();

public void makeDeposit()

Scanner cr=new Scanner(System.in);

System.out.println("Enter Account Number: ");

long acNum=cr.nextLong();

System.out.println("Enter Ammount: ");


double amt=cr.nextDouble();

Account acct=getAccount(acNum);

if(acct==null)

System.out.println("Sorry,Account not found");

else

acct.deposit(amt);

System.out.println("Deposit Successful");

System.out.println("Update Account Details");

acct.displayAcDetails();

System.out.println();

public void makeWithdrawal()

Scanner cr=new Scanner(System.in);

System.out.println("Enter Account Number: ");

long acNum=cr.nextLong();

System.out.println("Enter Ammount: ");


double amt=cr.nextDouble();

Account acct=getAccount(acNum);

if(acct==null)

System.out.println("Sorry,Account not found");

else

if(acct.withdraw(amt))

System.out.println("Deposit Successful");

System.out.println("Update Account Details");

else

System.out.println("Insuffcient Balance!!!");

System.out.println("Account Details");

acct.displayAcDetails();

System.out.println();;
}

public void displayAllAccount()

System.out.println("A/c No.\tName\tType\tBalance");

for(int i=0;i<acCount;i++)

System.out.println(accts[i].getAcNo() + "\t" +accts[i].getAcHolder()


+ "\t" + accts[i].getAcType() + "/t"

+ accts[i].getAcBal());

System.out.println();

public static void main(String args[])

int ch;

Bank bank=new Bank();

do

System.out.println("Main Menu");

System.out.println("1. Open New Account");

System.out.println("2. Deposit Amount");


System.out.println("3. Withdraw Ammount");

System.out.println("4. Check balance");

System.out.println("5. List All Accounts");

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

System.out.println("Make Your Choice (1 -6): ");

Scanner cr=new Scanner(System.in);

ch=cr.nextInt();

System.out.println("");

switch(ch)

case 1:

bank.openAccount();

break;

case 2:

bank.makeDeposit();

break;

case 3:

bank.makeWithdrawal();

break;

case 4:

bank.balanceEnquiry();
break;

case 5:

bank.displayAllAccount();

break;

case 6:

System.out.println("Bye");

break;

default:

System.out.println("Incorrect choice!!!");

while(ch !=6);

}
OUTPUT:
VARIABLE DESCRIPTION

DATA TYPE VARIABLE DESCRIPTION


long acNo,acNum To store account number
String AcHolder=Name,na
To store name of account
me holder
char acType,type
S for “SAVING” AND C
for
“CURRENT
double Store balance of
acBal,bal
customer
int TOTAL_ACCTS_LIMI
Limit of Account
T number=10
int acCount Count number of Account
int Ch Choose menu
amt
double Store deposit /withdraw
amount
Accounct Store each account
BIBLIOGRAPHY

These are the followed books I have referred


to for completing my project:

Computer Application by Aditi Arora


CONCLUSION
I am once again very grateful to our computer
teacher Mr.Soumitra Kalidaha and our lab
teacher Mr.Meghu Das for their guidance and
support. After completing this assignment I
conclude that it is very helpful to know
something more about java.

Thanking you.

Yours faithfully

Mahfuj Alam

You might also like