Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bank Account java class that must be done without a main method. A bank offers checking accounts to a variety of customers. The bank needs

Bank Account java class that must be done without a main method. image text in transcribed
A bank offers checking accounts to a variety of customers. The bank needs the following information for each account: Customer's Last Name (Smith, Jones, etc.) Balance (250.00, 500, etc.) Account Number (30045, 30051, 20076 etc.) When a BankAccount is initially created, the customer name and balance are given. The bank account number is set by the bank at a later time after the customer's paperwork is complete. Account balances are changed by customer deposits and withdrawals; withdrawals can only be made f the account has enough funds to leave a balance of at least $1, if there are not enough funds in the account the customer cannot make the withdrawal and they will get the message "Insufficient Funds. The bank has many different customers; a separate Bank Class (runner) will eventually need to print a list of all of the customers, the account numbers and the balances. You do not create this runner file- we are just creating the CLASS today. Implement (create) the BankAccount class. In implementing the class, you should Choose appropriate variable names and data types for this class Create an initialization constructor that takes in the customer name and balance. Create a setAccountNum method that allows the bank to set the customer's account number Create a getAccountNum method that returns the account number Create a getName method that returns the customer's name Create a getBalance method that returns the balance Create a deposit method that brings in a deposit amount and adds it to the balance. It does not display a new balance just adds it to the prior balance. Create a withdrawal method that checks to see if the account has enough money to cover the withdrawal to leave at least $1 in the account after the withdrawal, If it does, it will deduct the amount from the balance. If there isn't enough funds to withdraw and leave $1 in the account it should return "insufficient funds. Include a toString method that will print the customer name, account number and the account balance formatted as follows: Customer Name: Smith; Account Number 1011: Has a balance of $250.00 Be sure to properly identify access modifiers (private, public) of each method and instance field (variable) and include your curly braces for the class and methods! Don't forget your semi- colons

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Explain what a feasibility analysis is and why its important.

Answered: 1 week ago