Write a Java Program to create a bank account and to process transactions. Call this class bankAccount
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a Java Program to create a bank account and to process transactions. Call this class bankAccount
- A bank account can only be given an initial balance when it is instantiated. By default, a new bank account should have a balance of 0.
- A bank account should have a public get method, but no public set method.
- A bank account should have a process method with a double parameter to perform deposits and withdrawals. A negative parameter represents a withdrawal. It should not be possible to withdraw more than the current balance.
- A bank account should print method so that it can be printed easily. It should print as "The current balance is $___", with the correct value in the blank.
- write toString() method
- Write a driver program name it runAccount to input an amount from the user and instantiate a bank account with that initial balance, then input transactions until the user chooses to quit, printing the bank account after each transaction.
- Write a default constructor that initializes account balance zero
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: