Results 1 to 2 of 2

Thread: Quick Help!!

  1. #1
    MrA
    MrA is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Post Quick Help!!

    help with this HW!!!!!

    Instructions:

    In the BankProgram class you will have a constructor containing two BankAccount objects,
    one initialized to CheckingAccount and one initialized to SavingsAccount. In BankProgram
    you will also have a method called printAccountInfo(BankAccount account), which prints
    the information for the account specified as an argument, something like

    "You can use the following code to print the account amount with two decimal places:
    System.out.format("%.2f%n", account.getAccountBalance());
    When the program starts, it should first call printAccountInfo() on each BankAccount
    object, then present a menu of options, numbered 1, 2, 3 and 4, and wait for input. Describe
    each option when you list them, for example: “(1) Deposit money into checking account”.


    I try!!! :(






    public class BankProgram
    {
    public BankProgram()
    {
    BankAccount checking = new CheckingAccount();
    printAccountInfo(checking);
    BankAccount savings = new SavingAccount();
    printAccountInfo(savings);

    System.out.println("1,2,3,4,waiting for input");
    Scanner scanner = new Scanner(System.in);
    String response= scanner.nextInt();

    if(response == 1){
    System.out.print(response);
    System.out.println("(1) Deposit Money into Checking account");
    }
    if(response == 2){
    System.out.print(response);
    System.out.println("(2) Deposit Money into Saving account");
    }
    if(response == 3){
    System.out.print(repsonse);
    System.out.println("(3) Withdraw Money from Checking account");
    }
    if(response == 4){
    System.out.print(response);
    System.out.println("(4) Withdraw Money from Saving account");
    }
    }

    public void printAccountInfo(BankAccount account)
    {
    System.out.print(account.getAccountNumber + ": ");
    System.out.println("%2f%n", account.getAccountBalance());
    System.out.println(response);
    }

    public static void main(string[] args)
    {
    BankProgram app = new BankProgram();
    }
    }

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    What's the issue you're having? What have you tried to resolve this *particular* issue? What should be happening VS what IS happening? Are you receiving error messages? (If so, which ones, and what lines are they on?)

    Help us help you.

    PS: Please wrap code in [code][/code] tags. ;)

Similar Threads

  1. Quick help
    By locazor in forum New To Java
    Replies: 15
    Last Post: 10-17-2010, 07:07 PM
  2. Quick help
    By Qwertypoiuy in forum New To Java
    Replies: 5
    Last Post: 01-06-2010, 10:49 PM
  3. Hello everyone! quick question.
    By irishhokie in forum New To Java
    Replies: 5
    Last Post: 04-03-2009, 04:13 AM
  4. Need help quick!
    By Manikyr in forum New To Java
    Replies: 11
    Last Post: 01-28-2009, 04:08 AM
  5. Quick Question
    By Graeme in forum New To Java
    Replies: 4
    Last Post: 01-08-2009, 08:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •