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

  Implementing the insurance management system

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

  Make interface for major and suitable classes for it

Using C#. make the interface for major and make suitable classes for each major. In student course instantiate IMajor major variable. In toString method call major.

  Blinky lights

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

  Each salesperson passes

Thus, each salesperson passes between 0 and 5 slips per day. Assume that the information from all of the slips from last month are available. Write an app that will read all the information for last months sales and summarize the total sales by sales..

  Develop web services based application

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

  Write a program that computes the amount of money

Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is p..

  Name some form controls used with dotnet

Managing validation becomes a rather onerous task when you have to design a contact form, an event registration form, a sign in form, etc. What are some form controls used with .NET? Explain your answer.

  Create a website to allow pizza shop employee to enter order

Create a website in asp.net to allow the pizza shop employee to enter customer orders. The size of the pizza cam be entered using a drop down list, and the quantity be entered using a text box.

  Write an app to simulate the rolling

With C#, write an app to simulate the rolling of two dice. The app should use an object of class random once to roll the first die and again to roll the second die. The sum of the two values should then be calculated. Each die can show an integer val..

  Program that computes the amount of money the computer club

Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is p..

  A company wants to see a printout

A company wants to see a printout of the gross payroll for each of its 7 departments. The output should be a list of the seven departments and the total gross payroll (rate times hours) for each department

  Use techniques to read bouble value from text box

Use the techniques to read the Bouble value from a TextBox. [Note: ou may need to use methods Convert.ToDouble and Convert.ToDecimal when doing calculations with the number of hours and charges, respectively.

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