Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Devang
Bank
0 Answer(s)      2 years and 7 months ago
Posted in : Java Beginners


package com.tcs.ilp;

public class BankDetails
{
    String emp_id;
    String emp_role;
    double emp_salary;
    //String cust_name;
    //double loan_amount;
    //int branch_code;
    BankDetails(String id,String role,double salary)
    {
        emp_id=id;
        emp_role=role;
        emp_salary=salary;
    }
    void setSalary(double sala)
    {
        emp_salary=sala;
    }

}



package com.tcs.ilp;
import java.util.*;
public class BankFunctions 
{
    Scanner sc=new Scanner(System.in);
    void performFunctions()
    {
        ArrayList<BankDetails> arl=new ArrayList<BankDetails>();
        ArrayList<BankDetails> arl1=new ArrayList<BankDetails>();
        BankDetails bank1=new BankDetails("1001","agm",50000);
        BankDetails bank2=new BankDetails("1002","agm",40000);
        BankDetails bank3=new BankDetails("1003","dgm",30000);
        BankDetails bank4=new BankDetails("1004","gm",20000);
        BankDetails bank5=new BankDetails("1005","clerk",10000);
        BankDetails bank6=new BankDetails("1006","clerk",10000);
        arl.add(bank1);
        arl.add(bank2);
        arl.add(bank3);
        arl.add(bank4);
        arl.add(bank5);
        arl.add(bank6);
        int i1=1;
        while(i1!=-1)
        {
        System.out.println("YOUR COHOICES");
        System.out.println("1: VIEW EMPLOYEES SALARIES");
        System.out.println("2: GET LOAN");
        System.out.println("ENTER CHOICES");
        int ch=sc.nextInt();
        switch(ch)
            {
        case 1:
            System.out.println("OLD RECORDS ARE :");
            for(int k=0;k<arl.size();k++)
                {
                System.out.println(arl.get(k).emp_id);
                System.out.println(arl.get(k).emp_role);
                System.out.println(arl.get(k).emp_salary);
                }
            for(int i=0;i<arl.size();i++)
                {
                     if(arl.get(i).emp_role.equals("agm"))
                     {
                         double sal=arl.get(i).emp_salary;
                         sal=sal+.20*sal;
                         arl.get(i).setSalary(sal);
                     }
                     else if(arl.get(i).emp_role.equals("dgm"))
                     {
                         double sal=arl.get(i).emp_salary;
                         sal=sal+.15*sal;
                         arl.get(i).setSalary(sal);
                     }
                     else if(arl.get(i).emp_role.equals("gm"))
                     {
                         double sal=arl.get(i).emp_salary;
                         sal=sal+.10*sal;
                         arl.get(i).setSalary(sal);
                     }
                     else if(arl.get(i).emp_role.equals("clerk"))
                     {
                         double sal=arl.get(i).emp_salary;
                         sal=sal+.25*sal;
                         arl.get(i).setSalary(sal);
                     }
                }
            System.out.println("UPDATED RECORDS ARE :");
            for(int j=0;j<arl.size();j++)
                {
                    System.out.println(arl.get(j).emp_id);
                    System.out.println(arl.get(j).emp_role);
                    System.out.println(arl.get(j).emp_salary);
                }
            break;
        case 2:
            System.out.println("Enter the name");
            String cname=sc.next();
            System.out.println("Enter the loan amount");
            double camount=sc.nextDouble();
            System.out.println("enter the branch(1:jnk   2: bangalore 3: others");
            int bcode=sc.nextInt();
            if (bcode==1)
                {
                    if(camount>=100000 && camount<=500000)
                    {
                        System.out.println("Earlier Interest rates ="+11);
                        System.out.println("New rates are="+11.5);
                        System.out.println("Therefore yearly interest of" +.11*camount+ " goes to" +.115*camount);
                    }
                    else if(camount>=500000 && camount<=700000)
                    {
                        System.out.println("Earlier Interest Rate="+13);
                        System.out.println("New interest rates="+13.2);
                        System.out.println("net payment earlier of "+ .13*camount +"goes to "+ .132*camount);

                    }
                    else
                    {
                        System.out.println("Earlier Interest Rate="+15);
                        System.out.println("New interest rates="+16);
                        System.out.println("net payment earlier of "+ .15*camount +"goes to "+ .16*camount);
                    }

                }
            else if(bcode==2)
                {
                if(camount>=100000 && camount<=500000)
                {
                    System.out.println("Earlier Interest rates ="+11);
                    System.out.println("New rates are="+13);
                    System.out.println("Therefore yearly interest of" +.11*camount+ " goes to" +.13*camount);
                }
                else if(camount>=500000 && camount<=700000)
                {
                    System.out.println("Earlier Interest Rate="+13);
                    System.out.println("New interest rates="+15);
                    System.out.println("net payment earlier of "+ .13*camount +"goes to "+ .15*camount);

                }
                else
                {
                    System.out.println("Earlier Interest Rate="+15);
                    System.out.println("New interest rates="+18);
                    System.out.println("net payment earlier of "+ .15*camount +"goes to "+ .18*camount);
                }
                }
            else if(bcode==3)
            {
                if(camount>=100000 && camount<=500000)
                {
                    System.out.println("Earlier Interest rates ="+11);
                    System.out.println("New rates are="+12);
                    System.out.println("Therefore yearly interest of" +.11*camount+ " goes to" +.12*camount);
                }
                else if(camount>=500000 && camount<=700000)
                {
                    System.out.println("Earlier Interest Rate="+13);
                    System.out.println("New interest rates="+13.5);
                    System.out.println("Therefore earlier interest of "+ .13*camount +"goes to "+ .135*camount);

                }
                else
                {
                    System.out.println("Earlier Interest Rate="+15);
                    System.out.println("New interest rates="+16.5);
                    System.out.println("Therefore  earlier interest of "+ .15*camount +"goes to "+ .165*camount);
                }
            }

            }
        System.out.println("enter 1 to continue 0 to exit");
        int ter=sc.nextInt();
        if (ter==1)
        {
        i1++;   
        }
        else {i1=-1;}
        }
    }
}

package com.tcs.ilp;

public class BankMain 
{
    public static void main(String args[])
    {
        BankFunctions bafu=new BankFunctions();
        bafu.performFunctions();
    }
}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
bank application
bank application  hello sir I got the simple bank application project which is very useful but I want the database for this project kindly send me database for this simple online bank application
Advertisements
Bank project
Bank project   Create a class Customer a. Having Instance variables Customer id(int), Customer Name(String), Customer Address(String), Customer Telephone(String) and Customer Email id(String) b. Method which generates Customer Id
Bank Management System
Bank Management System  I need a Bank Management System Project in Java Swing
validate bank account number
validate bank account number  how to validate bank account number in jsp
validate bank account number
validate bank account number  how to validate bank account number in jsp
security mangement for bank's IT infrastructure
security mangement for bank's IT infrastructure  how i can give account number to a customer in our bank database??? plz help me out
abt the bank application
abt the bank application  pls can u send to me the user table and transaction table sql statement with their datatype used in this bank application to my email
how to generate bank account number?
how to generate bank account number?  how to generate account number?or format or rules for bank account number
bank details - JSP-Servlet
bank details  hi i just need a coding for bank details... since iam working as a trainee my leader gave me task like this.. What he want me to do is first to set the user account details in database, and the to create a login
bank management - Java Beginners
bank management  Assume that the bank maintains two kinds of accounts for its customers, one called savings account and the other current account. The savings account provides compound interest and withdrawal facilities
Bank account gui
Bank account gui  Add event handling to the AccountUI class which will allow you to: 1. Create new account, when the â??Createâ?? button... static void main(String arg[]){ Account at=new Account (); at.setTitle("Bank Account
bank account gui
bank account gui  Add event handling to the AccountUI class which will allow you to: 1.Create new account, when the ??Create?? button is pressed...[]){ Account at=new Account (); at.setTitle("Bank Account System"); at.setSize(500,300
simple bank application - JSP-Servlet
simple bank application  hi i got ur codings...But if we register a new user it is not updating in the database...so plz snd me the database also.... Thank you
Bank account manangement - Java Beginners
Bank account manangement  Assume that the bank maintains two kinds of accounts for its customers, one called savings account and the other current account. The savings account provides compound interest and withdrawal facilities
Simple Bank Application in JSP
Simple Bank Application in JSP       In this section, we have developed a simple bank... transaction report  for particular time period. We run this Bank Application
Java Bank Account Application
Java Bank Account Application Here we have created a Bank Account Application that will allow users to do their transactions. For this, user will have to enter all the required information like, name, account number, account type
project on bank management system - Swing AWT
project on bank management system  plz give me code to move from by clicking a button on one panel to other panel and the add textfield and label such as name , address etc to second panel and textfield are one below to other
Computer questions for Bank PO Exams and upsc competitive exams
Computer questions for Bank PO Exams and upsc competitive exams  Computer questions for Bank PO Exams and upsc competitive exams. These questions will help you to improve your basic knowledge of computers. characteristics
Mini project on Book Bank using netbeans tool with java and for database using mysql
Mini project on Book Bank using netbeans tool with java and for database using mysql  hi roseindia, i have need the miniproject on bookbank with the deisgn using the netbeans tool, and create the database for that using mysql
Mini project on Book Bank using netbeans tool with java and for database using mysql
Mini project on Book Bank using netbeans tool with java and for database using mysql  hi roseindia, i have need the miniproject on bookbank with the deisgn using the netbeans tool, and create the database for that using mysql
Design a class named BankAccount to hold datas for a bank account in Java using Bluej Software - Java Interview Questions
Design a class named BankAccount to hold datas for a bank account in Java using Bluej Software  1)Design a class named BankAccount to hold the following data for a bank account: - Balance - Number of deposits
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
Online Shopping Cart Services
and a student studying on scholarship can make good use of them. Every bank
 

 

 

DMCA.com