Search:

Type: Posts; User: mwardjava92

Search: Search took 0.19 seconds.

  1. Replies
    15
    Views
    2,139

    Re: Bank Balance - while loop - wont compile

    Ah now I get it, so I say newBalance =0 and deposit =0 ?
  2. Replies
    15
    Views
    2,139

    Re: Bank Balance - while loop - wont compile

    System.out.println("Please enter the amount of your deposit");
    deposit = keyboardIn.nextDouble();

    System.out.println("Your new balance is" + newBalance);
    newBalance = keyboardIn.nextDouble();
    ...
  3. Replies
    15
    Views
    2,139

    Re: Bank Balance - while loop - wont compile

    char response = 'Y';

    while (response == 'Y')

    System.out.println("Do you want to make another balance ( Y or N)?");
    response = keyboardIn.next().charAt(0);

    This is where I thought I'd...
  4. Replies
    15
    Views
    2,139

    Re: Bank Balance - while loop - wont compile

    Sorry guys I'm still confused, I thought I have the variable initialised already ?
  5. Replies
    15
    Views
    2,139

    Re: Bank Balance - while loop - wont compile

    Yeah I edited it so it's declared as 'Y' , but still not compiling.
    These are the 2 errors that I'm getting now:

    BankBalanceLoop.java:22: variable newBalance might not have been initialized...
  6. Replies
    15
    Views
    2,139

    Bank Balance - while loop - wont compile

    // Practical 8 - Q7
    // Marcus Ward
    // 07/11/2011
    /* Program to allow user to enter amount they wish to deposit.
    Program will continue until user says 'No'. The current bank balance is €500.00 */...
Results 1 to 6 of 7