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
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1589
Experience:  M.S. in Internet Information Systems
59032869
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

Resolved Question:

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:
---------------------------------------------
Deposit:
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:
--------------------------------------------------------------------------------------
Withdrawal:
Account Name = Gary Berg
Account Number = 22222
Withdraw money = $50 - Denied
New Balance = $60
---------------------------------------------------------------------------------------

If withdrawal is successful, print out the following:
------------------------------------------------
Withdrawal:
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
---------------------------------------------

HOW TO DO THE LAB:
-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
Notes:
-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
Submitted: 1 year ago.
Category: Homework
Expert:  TheDoctor replied 1 year ago.
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 1 year 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 +
"\n-------------------------------------";

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,
CURRENT_BAL_CHOICE = 2,
DEPOSIT_CHOICE = 3,
WITHDRAWAL_CHOICE = 4,
CHANGE_INTRATE_CHOICE = 5,
BANK_STAT_CHOICE = 6,
EXIT_CHOICE = 7;

Scanner keyboard = new Scanner(System.in);

BankAccount_Resende account = new BankAccount_Resende(accntNameTest, accntNbrTest,
startBal);



do
{
/* 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)
}
*/

showMenu();
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)
{
switch(choice)
{
case NEW_ACCNT_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(account.toString());

break;

case CURRENT_BAL_CHOICE:

System.out.println("-------------------------------");
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("-------------------------------");
break;

case DEPOSIT_CHOICE:

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

System.out.println("-------------------------------");
System.out.println("Deposit:");
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("--------------------------------");
break;

case WITHDRAWAL_CHOICE:

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

System.out.println("-----------------------------------");
System.out.println("Withdrawal:");
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("-----------------------------------");
break;

case CHANGE_INTRATE_CHOICE:

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

System.out.println("------------------------------------");
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("-------------------------------------");
break;

case BANK_STAT_CHOICE:

System.out.println("------------------------------------");
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("-------------------------------------");
break;

case EXIT_CHOICE:
System.out.println("Program is ending....");
break;

default:
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: ");
}
}

Expert:  TheDoctor replied 1 year ago.
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 1 year ago.

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

Expert:  TheDoctor replied 1 year ago.
Hello again Nuno!

Please download the Java files here:

DOWNLOAD

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, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1589
Experience: M.S. in Internet Information Systems
TheDoctor and 3 other Homework Specialists are ready to help you
Expert:  TheDoctor replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

    1781
    3,000+ satisfied customers, all topics, A+ work
 
 
 
Chat Now With A Tutor
TheDoctor
TheDoctor
Software Engineer
738 Satisfied Customers
M.S. in Internet Information Systems