How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask TheDoctor Your Own Question

TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Write the application BankSystem_YourLastName for the bank

This answer was rated:

Write the application BankSystem_YourLastName for the bank service. The application should display the following menu to allow users to do the following tasks:

1. Open new account
2. Current Balance
3. Deposit
4. Withdrawal
5. Change Interest Rate
6. Bank statement
7. Exit

The users can select one task to do the service. After finishing one task, the application will display the menu again to allow users to continue to work other tasks. The application only terminates when users want to exit.

For each task, the application will do the following:
Open new account:
-Display the message to ask users to provide the following information: account number, name, and amount of money to start the account. If the money to start the account is less than 100, display the message “The minimum amount to open a new account should be $100”
-After read all information, create an account object to pass all the information to the object then display the message as follows; the example with account number = 12345, name = “Annie Hogan”, amount to start = $200
New Account:
Account Name = Annie Hogan
Account Number = 12345
Start Balance = $200.00

Current Balance: read and display the current balance as the following format, for example
Check Balance:
Account Name = Bill Jones
Account Number = 11111
Current Balance = $2200.00

Deposit: ask and read the amount of money to deposit, re-calculate the balance by adding the deposit amount to the current balance, for example:
Account Name = Alec Goel
Account Number = 54321
Deposit = $100.00
New Balance = $1300.00
Withdrawal: ask and read the amount of money to withdraw. Withdrawing is denied when the balance < withdraw amount + $25. Otherwise, recalculate the balance by subtracting a withdraw amount from the balance.

If withdraw is denied, print out the message:
Account Name = Gary Berg
Account Number = 22222
Withdraw money = $50 - Denied
New Balance = $60

If withdrawal is successful, print out the following:
Account Name = Steward Lee
Account Number = 33333
Withdraw = $100.00
New Balance = $2300.00

Change Interest Rate: display message to ask and read the new interest rate, then set the new interest rate to the interest rate and display the change
Change Interest Rate:
Account Name = Relay Clinton
Account Number = 44444
New Interest Rate = .005%

Bank statement: calculate the interest amount based on the balance by using the formula: balance * interest rate / 100, the calculate the new balance: balance = balance + interest amount and print out the account information as the following format:
Account Name = Mary Lane
Account Number = 55555
Balance = $2300.00
Interest (.05% ) = $1.15
New Balance = $2301.15

-Create the class named BankAccount_yourLastName that holds accountName, accountNumber, balance, interestRate and have constructor and all the methods that support for each requested tasks.
-Create the controlling class named BankSystem_yourLastName that contains the method main to hold all the interaction between the application and the users as requested above
-When users select one task from 2 to 6 but the account does not exist, the application will display the message to warn users to open the new account first. To do this, before display the menu, declare an object of BankAccount and assign it to null. Anytime the users select the option from 2 to 6, check if the object of BankAccount is not null to continue because if the object of BankAccount goes through the Create- new- account task, it is created with the requested information passing to the object. Therefore, the object would not be null
Hello and thank you for your question. It would be my pleasure to assist you.

First, please let me know by when this is required.

Also, are you using any specific IDE in your class? (e.g., Eclipse, NetBeans, BlueJ)

Thank you
Customer: replied 2 years ago.

Well this assignment is due tonight at 10, the reason i took too long to ask for help is because i was trying myself as you can see below. im using the Jgrasp to write the program.


public class BankAccount_Resende
private String accountName; // To hold the account name
private int accountNumber; // To hold the account number
private double balance; // To hold the balance
private double interestRate; // To hold the interest rate
private double newBalance;
private double interest;

// non - argument constructor
public BankAccount_Resende()
accountName = " ";
accountNumber = 0;
balance = 0.0;

// Parameter constructor
public BankAccount_Resende(String accntName, int accntNbr, double startBalance)
accountName = accntName;
accountNumber = accntNbr;
balance = startBalance;


public void deposit(double amount)
balance += amount;

public void withdraw(double amount)
balance -= amount;

public void setInterestRate(int intRate)
interestRate = intRate;

public void bankStatement()
interest = balance * (interestRate / 100);
balance += interest;


public double getBalance()
return balance;

public double getInterestRate()
return interestRate;

public String getAccountName()
return accountName;

public int getAccountNumber()
return accountNumber;

public String toString()
String newAccnt = " ";
newAccnt = "--------------------------------------" +
"\nNew Account:" +
"\nAccount Name: " + accountName +
"\nAccount Number: " + accountNumber +
"\nStart Balance: " + balance +

return newAccnt;


import java.util.Scanner;
import java.text.DecimalFormat;

public class BankSystem_Resende
public static void main(String[] args)
String accntNameTest;
int accntNbrTest;
double intRateTest;
double startBal;
double depositAmt;
double withdrAmt;
double newIntRate;
int choice;

// Constants for menu choice
final int NEW_ACCNT_CHOICE = 1,

Scanner keyboard = new Scanner(;

BankAccount_Resende account = new BankAccount_Resende(accntNameTest, accntNbrTest,

/* BankAccount_Resende account = null;

if (choice >= CURRENT_BAL_CHOICE || choice <= BANK_STAT_CHOICE)
System.out.println("Please open a new account first.");
if (account != null)

choice = keyboard.nextInt();

while (choice < NEW_ACCNT_CHOICE || choice > EXIT_CHOICE)
System.out.println("Please enter a valid menu choice: ");
choice = keyboard.nextInt();

if (choice != EXIT_CHOICE)

System.out.print("Enter the account number: ");
accntNbrTest = keyboard.nextInt();
System.out.print("Enter the account name: ");
accntNameTest = keyboard.nextLine();
System.out.print("How much would you like to start the account: ");
startBal = keyboard.nextDouble();
if (startBal < 100)
System.out.println("The minimum amount to start the " +
"account is $100");
startBal = keyboard.nextDouble();




System.out.println("Check Balance:");
System.out.println("Account Name: " + account.getAccountName());
System.out.println("Account Number: " + account.getAccountNumber());
System.out.println("Current Balance: " + account.getBalance());


System.out.println("How much would you like to deposit? ");
depositAmt = keyboard.nextDouble();

System.out.println("Account Name: " + account.getAccountName());
System.out.println("Account Number: " + account.getAccountNumber());
System.out.println("Deposit : " + depositAmt);
System.out.println("New Balance: " + account.getBalance());


System.out.println("How much would you like to withdraw? ");
withdrAmt = keyboard.nextDouble();

System.out.println("Account Name: " + account.getAccountName());
System.out.println("Account Number: " + account.getAccountNumber());
System.out.println("Withdraw money: " + withdrAmt);
System.out.println("New Balance: " + account.getBalance());


System.out.println("Enter the the new interest rate: ");
newIntRate = keyboard.nextDouble();

System.out.println("Change Interest Rate:");
System.out.println("Account Name: " + account.getAccountName());
System.out.println("Account Number: " + account.getAccountNumber());
System.out.println("New Interest Rate: " + account.getInterestRate());


System.out.println("Account Name: " + account.getAccountName());
System.out.println("Account Number: " + account.getAccountNumber());
System.out.println("Balance: " + account.getBalance());
System.out.println("Interest (.05%): " + account.getInterestRate());
System.out.println("New Balance: " + account.getBalance());

System.out.println("Program is ending....");

System.out.println("The valid choices are 1 through 6. Run"
+ " the program again and select one of those");


} while (choice != EXIT_CHOICE);

public static void showMenu()
System.out.println("\t\tBank Account System Menu\n\n" +
"\t1.Open New Account\n" +
"\t2.Current Balance\n" +
"\t3.Deposit\n" +
"\t4.Withdrawal" +
"\t5.Change Interest Rate\n" +
"\t6.Bank Statement\n" +
"\t7.Exit\n\n" +
"\tEnter your choice: ");

Hello again Nuno!

It looks like you have done a lot of work here.

I will review your code and make any corrections/additions necessary to fulfill the requirements. I will contact you once this is ready.

Thank you
Customer: replied 2 years ago.

Thank you i will be waiting for your response...

Hello again Nuno!

Please download the Java files here:


I corrected various minor errors throughout your code, formatted the currency amounts as currency, and added a "Press enter to continue" functionality so that it doesn't spit out the output plus the menu again all in one go, making it difficult to follow.

The biggest issue throughout the code was the use of nextInt, nextDouble. These seem like the correct thing to use, but they are single byte input. So, if I enter 500 as the balance and you use nextDouble, it gets the number 5 only and does not cause a new line, so the next line then prints out on the same line and future attempts to do a nextLine have undesirable results because it will actually read the previous line with the 00 still on it.

The better way of doing this is to just use nextLine and then parse the string value into an Integer or Double, which is what i have done with the code.

You will see that the project now does everything that is stated in the requirements. You actually did a really, really good job with the code. Other than the input issue and a few minor issues, you did an excellent job. Before turning it in, you should go through and add comments to your code.

Let me know if you have any questions. I'm here to help!

Please remember to rate my answer. Thank you so much and have a wonderful day!
TheDoctor and 4 other Homework Specialists are ready to help you

You need to spend $3 to view this post. Add Funds to your account and buy credits.

Related Homework Questions