New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



To create Bank software using Java


Posted Date:     Total Responses: 0    Posted By: hasmukh   Member Level: Bronze   Points/Cash: 6   


Following code is To create Bank software using Java



import java.io.*;
import java.lang.*;
class Bank
{
double bal,damt,wamt;
String acct_type, acct_name;
int acctno;
void initial(int no, String type,String name,double balance)
{
acctno=no;
acct_type=type;
acct_name=name;
bal=balance;
}
void deposit(double amt)
{
damt=amt;
bal=bal+damt;
System.out.println("Amount Deposited: "+damt);
}
void withdraw(double at)
{
wamt=at;
if(bal>wamt)
{
bal=bal-wamt;
System.out.println("Amount Withdrawn: "+wamt);
}
else
{
System.out.println("Withdrawn Amount greater than balance \n Balance :"+bal);
}
}
void display()
{
System.out.println("Account Number: "+acctno);
System.out.println("Account Type: "+acct_type);
System.out.println("Account Name: "+acct_name);
System.out.println("Account Balance: "+bal);
}
}
class BankDemo
{
public static void main(String args[])throws IOException
{
DataInputStream in=new DataInputStream(System.in);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String name,type;
int no,choice,i;
double ba,wa,da;
boolean baless=false;
i=0;
System.out.print("Enter account number: ");
no=Integer.parseInt(in.readLine());
System.out.print("Enter account type: ");
type=br.readLine();
System.out.print("Enter account name: ");
name=br.readLine();
do{
System.out.print("Enter account balance: ");
ba=Double.parseDouble(in.readLine());
if(ba<1000)
{
baless=true;
System.out.println("Minimum balance must be Rs.1000");
}
else
baless=false;
}while(baless==true);
Bank b1=new Bank();
b1.initial(no,type,name,ba);
while(i==0)
{
System.out.print("1.Deposit\n2.Withdraw\n3.Display\n4.Exit\nEnter Choice: ");
choice=Integer.parseInt(in.readLine());
switch(choice)
{
case 1:System.out.print("Enter amount to be deposited: ");
da=Double.parseDouble(in.readLine());
b1.deposit(da);
break;
case 2:System.out.print("Enter amount to be withdrawn: ");
wa=Double.parseDouble(in.readLine());
b1.withdraw(wa);
break;
case 3:b1.display();
break;
case 4:i=1;
break;
default: System.out.println("Not a vaild choice.");
}
}
}
}


Project Feedbacks

Author: raga aravindMember Level: BronzeRevenue Score: 1 out of 5
its a nice way


Post Feedback
You must Sign In to post a feedback.
Next Project: Program to construct a pascal triangle
Previous Project: Software to add, delete and print an item in shopping list in java

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.