Big Java, Binder Ready Version: Early Objects
Big Java, Binder Ready Version: Early Objects
6th Edition
ISBN: 9781119056447
Author: Cay S. Horstmann
Publisher: WILEY
Question
Book Icon
Chapter 20, Problem 10PE
Program Plan Intro

BankAccount

Program plan:

BankAccount.java:

  • Create a class named “BankAccount”. Inside the class,
    • Define the required variables.
    • Define the “BankAccount ()” method.
      • Initialize the variables
    • Define the “depsoit ()” method.
      • Calculate the balance
    • Define the “withdraw ()” method.
      • Calculate the balance
    • Define the “getbalance ()” method.
      • return the balance
    • Define the “compareTo ()” method.
      • Calculate the balance
      • Validate the balance amount and return the corresponding value.

BankAccountFrame.java:

  • Create a class named “BankAccountFrame”. Inside the class,
    • Define and declare the required variables.
    • Set the width and height of the frame
    • Define the method “BankAccountFrame”
      • Assign the required variables
      • Create the required labels.
      • Create a new panel
      • Add the components to the frame.
      • Set the size of the frame
    • Define the method “createDepositButton”
      • Create new button
      • Define the class “DepositListener”
        • Define the method “actionPerformed”
          • Define the values
          • Set the values to the labels
        • Define the action listener
        • Return the deposit amount
    • Define the method “createWithdrawButton”
      • Create new button
      • Define the class “WithdrawListener”
        • Define the method “actionPerformed”
          • Define the values
          • Set the values to the labels
        • Define the action listener
        • Return the withdrawn amount

BankAccountViewer.java:

  • Create a class named “BankAccountViewer”. Inside the class,
    • Define the required variables
    • Define the “main()” method
      • Define the frame
      • Set the close operation
      • Set the title
      • Set the visibility.

Blurred answer
Students have asked these similar questions
4. |z + 5 - 5i| = 7
14. dz, C: |z❘ C: |z❘ = 0.6 ze² - 2iz H
14. dz, C: |z❘ C: |z❘ = 0.6 ze² - 2iz H
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education