Question

In: Computer Science

You will be writing a small bank application. There will be two applications to this project...

You will be writing a small bank application. There will be two applications to this project – a client and a teller / administrative application with different functionalities between the two. As their names suggest, the client application will be tailored for customers of the bank, and the other for the employees of the bank.

For your client side application, a client should be able to “log into” the program by providing a social security number. The program should only load information pertaining to the current user. A user should be able to see a list of his or her account, and view details of the accounts – balance, account type, whether it’s frozen… A user should be able to change his or her phone number and address, but not other information (name, ssn, or credit score). A user should be able to make deposits or withdrawals and make payments towards a loan. A user may request a loan, but may only have one outstanding request for a loan.

Solutions

Expert Solution

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class GuiAccTest extends Frame implements ActionListener
{
        Label lab=new Label("                                                                                                                                                                 ");
        Label lab1=new Label("                                                                                                                                                                 ");
        TextField t[]=new TextField [4];
        Label l[]=new Label [4];
        Button but=new Button("Create Account");
        Button but1=new Button("Test Account");
        BankAccount b;
        GuiAccTest()
        {
                addWindowListener(new NewWindowAdapter());
                setLayout(new GridLayout(2,0));
                Panel p=new Panel();
                Panel p1=new Panel();
                but.addActionListener(this);
                but1.addActionListener(this);
                p.setLayout(new GridLayout(5,2));
                p1.add(lab1);
                p1.add(lab);
                l[0]=new Label("Account Number");
                l[1]=new Label("Initial Balance");
                l[2]=new Label("Deposit Amount");
                l[3]=new Label("Withdraw Amount");
                for(int i=0;i<4;i++)
                {
                        t[i]=new TextField(10);
                        p.add(l[i]);
                        p.add(t[i]);
                }
                p.add(but);
                p.add(but1);
                but1.setVisible(false);
                l[2].setVisible(false);
                l[3].setVisible(false);
                t[2].setVisible(false);
                t[3].setVisible(false);
                add(p);
                add(p1);
        }
        String testAccount(int d_amt,int w_amt)
        {
                String msg;
                b.deposit(d_amt);
                msg="Transaction Succesful";
                try
                {
                        b.withdraw(w_amt);
                }catch(FundsInsufficientException fe)
                {
                        fe=new FundsInsufficientException(b.amount,w_amt);
                        msg=String.valueOf(fe);
                }
                return msg;
        }
        public void actionPerformed(ActionEvent ae)
        {
                String str=ae.getActionCommand();
                if(str.equals("Create Account"))
                {
                        b=new BankAccount(Integer.parseInt(t[0].getText()),Integer.parseInt(t[1].getText()));
                        but1.setVisible(true);
                        l[2].setVisible(true);
                        l[3].setVisible(true);
                        t[2].setVisible(true);
                        t[3].setVisible(true);
                        but.setVisible(false);
                        l[0].setVisible(false);
                        l[1].setVisible(false);
                        t[0].setVisible(false);
                        t[1].setVisible(false);
                        lab1.setText("Account : "+b.accnum+", Current Balance : "+b.amount);
                        return;
                }
                else
                {
                        lab.setText(testAccount(Integer.parseInt(t[2].getText()),Integer.parseInt(t[3].getText())));
                        lab1.setText("Account : "+b.accnum+", Current Balance : "+b.amount);
                }
        }
        public static void main(String arg[])
        {
                GuiAccTest at=new GuiAccTest();
                at.setTitle("Bank Account Tester");
                at.setSize(600,200);
                at.setVisible(true);
        }
}
class NewWindowAdapter extends WindowAdapter
{
        public void windowClosing(WindowEvent we)
        {
                System.exit(0);
        }
}
class BankAccount
{
        int accnum;
        int amount;
        BankAccount(int num,int amt)
        {
                accnum=num;
                amount=amt;
        }
        public void deposit(int amt)
        {
                amount=amount+amt;
        }
        public void withdraw(int amt) throws FundsInsufficientException
        {
                if(amt>amount)
                        throw new FundsInsufficientException(amount,amt);
                else
                        amount=amount-amt;
        }
}
class FundsInsufficientException extends Exception
{
        int balance;
        int withdraw_amount;
        FundsInsufficientException(int bal,int w_amt)
        {
                balance=bal;
                withdraw_amount=w_amt;
        }
        public String toString()
        {
                return "Your withdraw amount ("+withdraw_amount+") is less than the balance ("+balance+"). No withdrawal was recorded.";
        }
}


Related Solutions

You will design and create your own GUI application for the Bank project. This project should...
You will design and create your own GUI application for the Bank project. This project should be designed and written by Java programming. The requirements of the program: 1. The program will be best implemented as a multi-file program for each class. 2. The parameters and return types of each function and class member should be decided in advance. You may need to add more member variables and functions to the classes than those listed below. Also, you can throws...
What are the most common reasons the bank rejects small business loan applications?
What are the most common reasons the bank rejects small business loan applications?
Assume that you are writing an application that will calculate the amount of interest earned for...
Assume that you are writing an application that will calculate the amount of interest earned for a bank account. a) Identify the potential classes in this problem domain. b) Refine the list to include only the necessary class or classes for this problem. c) Identify the responsibilities of the class or classes. d) Design the UML diagram.
You are considering purchasing a small commercial property for $1,000,000. A bank has offered you two...
You are considering purchasing a small commercial property for $1,000,000. A bank has offered you two different loan options, the first would require a down payment of 30% and would have an interest rate of 5.25%. The second option would require a downpayment of only 20%, but the interest rate would rise to 6%. Both loans would have 25 year terms. After determining your monthly payment for each, calculate how much you are effectively paying (solving for RATE) for the...
For your final project, you are to create a two-page web application of your choice. ASP.NET...
For your final project, you are to create a two-page web application of your choice. ASP.NET : C# You must include the following items: At least 5 different standard server controls At least 2 validation controls At least 1 navigation control ~ one must navigate back and forth to each page One session state element Upon completion of your two-page web application, you will provide a two page report describing the functions of the web application as well as each...
You are the in-house counsel for a small bank (the “Bank”) located in Northwest Colorado. The...
You are the in-house counsel for a small bank (the “Bank”) located in Northwest Colorado. The Bank has three locations: Steamboat Springs, Hayden and Craig. The Bank offers a broad range of banking services, such as making personal and commercial loans and offering various types of savings and checking accounts. The vast majority of the Bank’s customers live in Routt, Moffat and Rio Blanco Counties. The Bank has a reputation as being a friendly, small town bank that knows its...
The first step in writing a software application is to determine the requirements. There is no...
The first step in writing a software application is to determine the requirements. There is no value in writing a program that does not address the needs of the client. Requirements can be gathered in many ways, but ultimately, the requirements serve to document what the application should and should not do. After the requirements are written, the application design can be prepared, followed by the actual coding. For this project, you will gain some practice in the design phase...
You are a loan officer for National Bank. You have a loan application submitted by a...
You are a loan officer for National Bank. You have a loan application submitted by a company for $50,000. This company just got a prior loan for $45,000 and has not made the first payment. This gives you an uneasy feeling as you examine a loan application from ABC, Co. The application included the following financial statements. ABC, Co. Income Statement For the Year Ended December 31, 2018 Sales revenue                                 $100,000 Cost of goods sold                         (50,000) Depreciation expense                   ...
Create a project plan on the game or application you are creating. The project plan should...
Create a project plan on the game or application you are creating. The project plan should include the following: A description of the game or application The IDE or game engine your plan to use to create the game or app and information on how you are going to develop the game or app If you choose to create a game, how are you going to approach the game design and game development process or if you choose an application...
Search the internet for real-world applications of logarithms or exponential functions. Share the application you discovered...
Search the internet for real-world applications of logarithms or exponential functions. Share the application you discovered with the class along with how it relates to logarithms or exponential functions. Besure to cite the resource. What is the relationship between exponentials and logarithms?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT