Create account management with java

Assignment Help DOT NET Programming
Reference no: EM13165100

Create account management with java gui using a MVC model.create withdraw, create account, deposit , trasfer , balance , on the main fram. and On pressing one of these buttons a window "Start deposit/withdraw for ac count: account ID suppose to show up. The accountI D should correspond to the account selected in the drop-down list of the main window when a "Create ... agent" button was pressed. " " agent window contains some editable textfield( id, amount in, operations per second On pressing per second" initialized to 0.0, it accepts only digits and a decimal point


Pleasecheck code and then fix my code, i'm kind of lost.

Model

package model;
import java.util.Scanner;

/** using MVC model to create a account management program */
/** Design Model class*/
/** A model is an object representing data or even activity*/


public class AccountModel {

   private final double euro = 0.72; /** set variables*/
   private final double yuan = 6.2;
   private String id;
   private String name;
   private double balance;


   public AccountModel(String id, String name, double balance) {
   super(); /**constructs a new instance of a this class*/
   this.id = id; /** design methods for managing account*/
   this.name = name;
   this.balance = balance; /** original amount of usd money*/
   }

   public String getId() { /** set and getting ID*/
   return id;   
   }

   public void setId(String id) {
   this.id = id;
   }

   public String getName() {
   return name; /** set and getting Name*/
   }

   public void setName(String name) {
   this.name = name;
   }

   public double deposit(double amount)
   { /** design deposit method*/
       System.out.print("Enter the amount of deposit:\n");

       Scanner SC = new Scanner(System.in);
       amount=SC.nextDouble();
   try{ balance= balance+amount;
   } catch(Exception e){};
   /** using exception for prevent runtime error*/
   return balance;
   }
   public double withdraw(double amount)
   {
       System.out.print("Enter the amount of withdraw:\n");
Scanner SC = new Scanner(System.in);
           amount=SC.nextDouble(); /** design withdraw method*/
           try{
       balance= balance-amount;
           } catch(Exception e){};
           return balance;
   }
   public double editin_euro()
   { try{ /** translate usd to Euro*/
   balance = balance * euro;}
   catch(Exception e){};
   return balance;
  
   }
   public double editin_yuan()
   {
   try{ /** translate usd to yuan*/
       balance = balance / yuan;
   } catch(Exception e){};
   return balance;
   }
   public double getBalance()
   {
   return balance;
   }
  
      
     
}

view

package model;

import java.util.Scanner;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/** design view class, represents the visualization of the data that model contains*/

public class AccountView extends JFrame {

      
     
       AccountView(){
       setTitle("Bank managemet system");
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       setLayout(new BorderLayout());
       add(new JButton("createAccount"),BorderLayout.CENTER);
       add(new JButton("deposit"), BorderLayout.NORTH);
       add(new JButton("withdraw"), BorderLayout.SOUTH);
       add(new JButton("transfer"), BorderLayout.EAST);
       add(new JButton("balance"), BorderLayout.WEST);
       setSize(300,200);
       setVisible(true);
       JButton btn= new JButton("deposit");
       Action_Listner listener= new Action_Listner();
       btn.addActionListener(listener);
       add(btn);
       }
      
       public static void main(String[] args)
       {
           new AccountView();
       }
      
       public void Accountview(String name,String id, Double money) {
              System.out.println("Name: " + name);
              System.out.println("ID: "+ id); /** Main informations for print out on screen*/
              System.out.println("Balance: " + money);
              }
             
      
}

Control

package model;
/**design controller class that for acting on both model and view.
* it controls the data flow into model object and updates the view
* where ever data changes. it keeps view and model seperates
*
*
*/
public class AccountController {
   private AccountModel model; /** call model and view */
   private AccountView view;
  
   public AccountController(AccountModel model, AccountView view) {
   this.model = model;
   this.view = view; /**controllthe data flow bot model and view */
   }
  
   public void setaccountName(String name) {
   model.setName(name);
   }
  
   public String getaccountName() {
   return model.getName();
   }
  
   public void setaccountid(String id) {
   model.setId(id);
   }
  
   public String id() {
   return model.getId();
   }
   public Double balance()
   {
   return model.getBalance();
   }
   public void updateView() { /** updates the view information when it is changes*/
   view.Accountview(model.getName(), model.getId(),model.getBalance());
   }
   }

Reference no: EM13165100

Questions Cloud

State what is the value of the acid dissociation constant : A saturated solution (aqueous) of the acid contains 11 g/L and has a pH = 2.94. What is the value of the acid dissociation constant?
Pplying the four necessary conditions for deadlock : Assume a multithreaded application uses onlyreader-writer locks for synchronization. Applying the four necessary conditions for deadlock, is deadlock still possibleifmultiple reader-writer locks are used?
Calculate the heat needed : Calculate the heat needed at 0 degrees celsius to make each of the following changes of state. kilocalories to freeze 285 of water.
State what volume of ammonia gas measured to neutralize : What volume of ammonia gas measured at 762 mm Hg and 21.0 °C must be absorbed by the same solution to neutralize the HCl?
Create account management with java : Create account management with java gui using a MVC model.create withdraw, create account, deposit , trasfer ,balance , on the main fram. and On pressing one of these buttons a window "Start deposit/withdraw for ac count: account ID suppose to sho..
What is the atomic mass of unknown element x : What is the atomic mass of unknown element X if it has the following isotopic composition.
Program to track hourly employee arrival and departure time : THE JAVA SOURCE CODEA company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock. The time clock shall keep a history of an employee’s hours for a two-w..
Client expresses concern-bone marrow aspiration : A client expresses concern over the discomfort expected during the bone marrow aspiration. The nurse can best address these concerns by informing the client
What is the new concentration of the acid : A bottle of 5.5 M acid has 21.3 mL remaining in it. If the acid is diluted to 700 mL, what is the new concentration of the acid?

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Develop web services based application

Develop and test a Web services based application that meets the requirements applying SOA design principles.

  Design style elements in asp

Add drop down lists for modifying the different style elements for the label element that displays the time

  Create a shopping cart in asp

The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.

  Inventory management system in c# application

Inventory management system in c# application

  Using .net resources to teach .net

This project will use the .NET framework to produce a set of materials to demonstrate the fundamental principles of .NET. Ideally it should demonstrate some of the principles of the framework e.g. interoperability.

  Prepare a marymount faculty site

Prepare a Marymount faculty site

  Blinky lights

Analysis proving that your code blinks the LEDs at the specified rates.

  Prepare a web application

Prepare a web application that will be used to keep track of patients registering in a hospital.

  Implementing the insurance management system

Implementing the Insurance Management System and implementation of Components as Web Services.

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Prepare a web application for internet service provider

Prepare a Web application and write the code also event planning document base. This web application allows the user to sign up for an Internet service provider for home connectivity.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd