Home Answers Viewqa Java-Beginners banking with atm

 
 


surya prakash
banking with atm
2 Answer(s)      9 months ago
Posted in : Java Beginners

hai am having problem with comparing all arrays i.e how to compare all arrays with single string there is any function please help me.

class Compare
{
main()
{
int idno[] = {1,2,3,4,5,6};
int input;
Print("Enter no ");
Scanner scan = new Scanner(System.in);
input = scan.nextInt();
if(input = idno[])
{
print("id no is : " + input);
} 
  • o/p:

Enter no 4

id no is :

please help me to compare all arrays with single string

View Answers

July 31, 2012 at 12:22 PM


import java.util.Scanner;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.Statement;

import java.util.Date;

public class Bankingdemo2 {

public static void main(String[] args) 

{
    int pinno=0;
    int amount=0;

    int menu;
    int withdraw;
    int transfer=0;
    int update=0;

    Date date =  new Date();

    Connection con = null;

    String url = "jdbc:mysql://localhost:3306/";

    String db = "CLIENT";

    String driver = "com.mysql.jdbc.Driver";

    String user = "root";

    String pass = "";
    int idno[] = {2700,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712};

    Scanner scan = new Scanner(System.in);

    try
    {
        Class.forName(driver);

        con = DriverManager.getConnection(url + db, user, pass);

        System.out.println(date);
        System.out.println("\t"+"Menu"+"\n");
        System.out.println("1. Deposit Amount");
        System.out.println("2. Withdraw Amount");
        System.out.println("3. Display Information");
        System.out.println("4. Transfer Amount ");
        System.out.println("5. Exit");

        boolean quit = false;

        do 

        {

                System.out.print("Please enter your choice: ");

                menu = scan.nextInt();

                switch (menu)

                {

                case 1:                                         //.......DEPOSIT .........//    

                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();
                    Statement st1  = con.createStatement();
                    ResultSet res1 = st1.executeQuery("SELECT balance from CLIENT.bank where idno=2701");
                    if(pinno==idno[0])

                    {
                        while (res1.next()) 
                        {
                            System.out.printf("Current Balance  : "+"%,d"+"\n",res1.getInt(1));

                            amount=res1.getInt(1);


                        }
                        System.out.println("");
                        System.out.println("Enter deposit amount : ");
                        withdraw = scan.nextInt();

                        amount = amount + withdraw;
                        System.out.printf("Available balance : "+"%,d"+"\n" ,amount);
                        st1.executeUpdate("update bank set balance='"+amount+"' where idno=2701");
                    }

                        break;




                case 2:                                         

                    //...............................WITHDRAW.........//


                    Statement st2  = con.createStatement();
                    ResultSet res2 = st2.executeQuery("SELECT balance from CLIENT.bank where idno=2701");
                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();


                    if(pinno==idno[0])

                    {
                        while (res2.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res2.getInt(1));

                            amount=res2.getInt(1);
                        }

                        System.out.println("");
                        System.out.println("Enter withdraw amount : ");
                        withdraw = scan.nextInt();

                        amount = amount - withdraw;
                        System.out.printf("Available balance : "+"%,d"+"\n" ,amount);
                        st2.executeUpdate("update bank set balance='"+amount+"' where idno=2701");
                    }

                        break;




                case 3:


                    //...............DISPLAY.........//


                    Statement st3  = con.createStatement();
                    ResultSet res3 = st3.executeQuery("SELECT * FROM CLIENT.bank where idno='"+pinno+"' ");
                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();

                    if(pinno>=idno[])

                    {
                        while (res3.next()) 
                        {

                        System.out.println(res3.getString(1)+"\t"+res3.getString(2)+"\t"+res3.getString(3)+"\t"+res3.getString(4));
                        }
                    }

                        break;

                case 4: 


                    //.........................TRANSFER.........//


                    Statement st  = con.createStatement();
                    ResultSet res = st.executeQuery("SELECT balance from CLIENT.bank where idno=2701");

                    Statement st4  = con.createStatement();
                    ResultSet res4 = st4.executeQuery("SELECT balance from CLIENT.bank where idno=2707");

                    System.out.println("Enter PIN number : ");  
                    pinno =  scan.nextInt();


                    if(pinno==idno[0])

                    {
                        while (res.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res.getInt(1));

                            transfer=res.getInt(1);
                        }
                        while (res4.next()) 
                        {

                            System.out.printf("Current Balance  : "+"%,d"+"\n",res4.getInt(1));

                            update=res4.getInt(1);
                        }

                        System.out.println("Enter PIN number : ");
                        int pinno1 = scan.nextInt();
                        if(pinno1==idno[6])

                        {



                        System.out.println("Amount to transfer : ");
                        withdraw = scan.nextInt();

                        transfer = transfer - withdraw;

                        update = update + withdraw;

                        System.out.printf("Available balance : "+"%,d"+"\n" ,transfer);
                        st4.executeUpdate("update bank set balance='"+update+"' where idno=2707");
                        st.executeUpdate("update bank set balance='"+transfer+"' where idno=2701");


                    }
                    }

                        break;

                case 5: 
                    System.out.println("Thank You !");

                    quit = true;        //....EXIT...//

                }
        }
        while (!quit);


        con.close();    
    }


    catch (Exception e) 
    {

        System.out.println(e);
     }

}

}


July 31, 2012 at 1:10 PM


Here is a code that accepts the number and compare the number with the array. If the number exists in the array, the code displays that number.

import java.util.*;

class Compare { 
    public static void main(String []args) { 
        int idno[] = {1,2,3,4,5,6};
        int input;
        int no=0;
        System.out.print("Enter no: ");
        Scanner scan = new Scanner(System.in);
        input = scan.nextInt();
        for(int i=0;i<idno.length;i++){
        if(input == idno[i]) { 
            no=input; 
            } 
        }
        System.out.println(no);
    }
}









Related Pages:
banking with atm
banking with atm  hai am having problem with comparing all arrays i.e how to compare all arrays with single string there is any function please help me. class Compare { main() { int idno[] = {1,2,3,4,5,6}; int input
ATM
ATM  How do I create interfaces for banking system using Java
net_banking
net_banking  hi, I am developing a project on net_banking.. and want to know how to calculate the processing fees on loan(home/vehicle/personal)depending upon loan amount
atm machine code - Framework
atm machine code  plz send me the code of atm machine in c#.reply
ATM IN JAVA RMI - RMI
ATM IN JAVA RMI  How to write code for ATM using Java RMI
ATM machine in c#
ATM machine in c#  i am looking for a code that will be able to create an account and be able to log-in to the atm machine
Banking projecy
Banking projecy  Sir I am designing a banking project where i want... help me   Hi buddy. Please make clear that the banking application you... the technology used is Java.   Hi Ankita. Please make clear that the banking
net banking
net banking  hi.... I am developeing a net banking project...and i want coding for following... this module for new loan application... First Name,Last Name, Salaried /business, Current Organization, Resident Address, Office
atm code in servlet& jsp
atm code in servlet& jsp  pls send me the code of ATM project in servlet jsp . my requirements are first of all an user login window open then balance enquiry, withdraw of money, money transfer, then log out. pls send as early
ATM Logic - Java Beginners
ATM Logic   Q-In an ATM program i want to print the receipt in which there is information of rupees note that come out from an ATM machine when user... Note: The ATM should check for particular rupee note whether it is available
codes for banking databases
codes for banking databases  sir PLZ give me codes for banking database using java
codes for banking databases
codes for banking databases  sir plz give me codes for creating a banking database using java
codes for banking databases
codes for banking databases  sir plz give me codes for creating a banking database using netbeans as back end and java as front end
Simple ATM Java Code...
Simple ATM Java Code...  You are required to write a Graphical User Interface that simulates an ATM by building on the program you wrote... list, following which your ATM becomes operational for use by your customers
banking project database
banking project database  i want to make a project on banking using applet pls help me out in making the project   JSP Bank Application
code for ATM - Java Beginners
code for ATM  How to write code for ATM?  can you plz... javax.swing.event.*; public class ATM extends Applet { public void init... { // setting up a pin that is needed for the atm private
ATM Java Code - Java Beginners
ATM Java Code  how to write ATM code that requirement is 1)user can insert name, account number, current balance,transaction type, 2)if select transaction is money deposit, the value will be input and current balance
online banking application
online banking application  i want to develope online banking application by using jsp with oracle 10g database but i have problem to view the mini statement and balance enquiry...when we entered accontno and pin and select
mobile banking login program
mobile banking login program  static Display dis; static Login destroy; public Login() { dis=Display .get Display(this); } public void startApp() { destroy=this; LoginScreen
LINKING PAGES OF PROJECT ON BANKING MANAGEMENT
LINKING PAGES OF PROJECT ON BANKING MANAGEMENT  SIR. pls i want to know how to link pages such that by clicking a button different page gets open on which we can make addition or we can edit?? i m making project on Banking ..pls
Simple banking system using Java
Simple banking system using Java  I am trying to make a simple banking system that has only 3 interfaces which does not connect to the database. a person can be able to deposit and withdraw. One interface is the main office
please send me the banking data base in swings
please send me the banking data base in swings  sir, please send me how to create the banking data base program in swings
Auto Teller Machine Emulator : (ATM Emulator)
Auto Teller Machine Emulator : (ATM Emulator)  following functionalities : a) Create an ATM cash deliver emulator application that will have... as input through ATM machine and give the cash amount. ATM machine has
atm java program - Java Interview Questions
atm java program  i need an atm system program java code that requires a user to enter his pin.then after entering the pin,it will ask again the user to select from 3 choices such as [1]Inquiry [2]Withdraw [3]Deposit.then if he
about banking application - Servlet Interview Questions
about banking application  i put 2+ fake on banking application the interviewers are asking me where u used servlets,jsp and how .they are also asking about the how you r using jdbc (rdbms oracle). tell about this problem  
BI: Improving performance in financial service
banking, security exchange and international finance like currency exchange and foreign investment. The chief banking sector is the major field with savings, loans
Our Solutions, Rose India Software solutions, Software Solutions
Solutions Rose India offers a comprehensive range of software and IT solutions, including packaged applications for the Banking, Financial Services... Banking Capital Market
What is CICS?
, ATM systems, as well as state and national governments. CICS can also perform
java code
java code  develop a banking system in java
Database Web Designing
Database Web Designing With the maturity of internet, the data bank of database has swelled several times due to rapid growth in e-business, e-commerce, internet banking, online transaction and online services. The companies have
What is IVR?
days  in the  BPO, KPO, and Banking sector as well as in-house and 
The Greatest Management Decisions that made the History
showing the citizen walking towards the nearest Citi bank ATM for their banking... of the bank along with its new technology in banking, ATM machine. After the introduction... present of the banking facility through ATM machines all over the country
Fantasy Sports Applications ? The Fun Will Find You
and play music, all the way to allowing you to do your banking and shopping online
please help me - Java Interview Questions
Banking application in Java  What is the Entire flow of banking project? Means how the communication between the view,model and controller? How the communication between the fronted, middle end and back-end
Online Shopping Cart Services
than having to use the ATM pin online for cash transactions. E-commerce website... is secure even if you use net banking. When one wants to choose a shopping cart
PROJECT
PROJECT  i want help on making project on mobile banking application..... the application should have SAVING ACCOUNT,CURRENT ACCOUNT,TRANSACTION ETC......... IN APPLICATION
java question
java question  sir, can you give me the code for online banking using netbeans and mysql in j2ee with its database connectivity
java question
java question  sir, can you give me the code for online banking using netbeans and mysql in j2ee with its database connectivity
java programming - Java Beginners
java programming  heloo expert, thanks for your coding i recently asked about the question on abt how to program a atm system may i noe in which platform can i run those codes ?? netbeans ?? any suggestions
programme
programme  Using an ATM, customer can access their bank accounts in order to credit/debit cash and check their account balances.You have to write c programme to implement a simple ATM for 15 customers. Initially you have to store
Free Java Projects - Servlet Interview Questions
Free Java Projects  Hi All, Can any one send the List of WebSites which will provide free JAVA projects with source code on "servlets" and "Jsp" relating to Banking Sector?  don't know
Real Time Example Interface and Abstract Class - Java Beginners
Real Time Example Interface and Abstract Class  Hi Friends, can u give me Real Time example for interface and abstract class.(With Banking Example
java - JMS
java  HOw to use jms in java progrmming. and also can u send me simple explanation and also code? This jms , How to add existing banking project
which one is better Struts2 or JSF
which one is better Struts2 or JSF  Which framework is better for the development of core banking solution for the presentation layer Struts2 or JSF2.Request you to explain with the valide reason. Thanks in Advance
MINI PROJECT
Chat server Inventory management FTP server ATM simulator Human resource
Java Cash Dispenser
Java Cash Dispenser You all are aware of ATM machines. It prints the receipt and provides you the requested amount. Here we are going to do the same thing i.e...*; class ATM { public static void main(String[] args) { Scanner input
java
pament in my account through A.T.M. tranjections or swapping machin.could u give
java programming - Java Beginners
question is how to program a atm machine consept by using java ?? im having problem in that to create a program similiar like d atm machine using java.. ... javax.swing.event.*; //This class defines one field in a record public class ATM
cashdispenser.java - Java Beginners
to be done..that if there are 1000 pcs. of 1000 pesos stored on an atm machine

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.