Search:

Type: Posts; User: Norm

Search: Search took 0.21 seconds.

  1. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Why do You call the withdraw method 3 times here?
    Seems like you should only call it once if it changes the balance of the account.



    int balance1 = balance - (wager);
    Does this code change...
  2. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Nor do I without seeing the code.



    You don't say that subtracting twice is the wrong thing to do. It could be the right thing if the player were to make two wagers.
  3. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Is it working now?

    What if the balance goes negative?
  4. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    b1.withdraw(wager1,wager1);
    Why do you pass the same amount as two arguments?

    How does the withdraw method do the two steps listed in post #17?
    What code do you have that does those two steps?
  5. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Why does it call itself to do this?
    1) subtract the wager from the balance
    2) return me that int.

    What are the two statements that will do those two steps?


    No, it should only do this for...
  6. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    What is the withdraw method supposed to do?
    Where in your code do you need to call the withdraw method to do that job?

    Explain how you want your program to work.
  7. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    A method calls itself
    and that new invocation of the method calls itself
    and that new invocation of the method calls itself
    and that new invocation of the method calls itself
    and that new...
  8. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    It looks like you have a recursive call to the withdraw method. It should NOT be calling itself.
  9. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Please post the full text of the error message. Your edited version left off important information.
  10. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    What happens when you execute the program? Can you copy the console and paste it here?
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select...
  11. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    You've done a much better analysis of the OPs code. I usually wait to see if they come back.
  12. Replies
    24
    Views
    1,851

    Re: Dice Wagering Game new to Multiple Classes

    Please copy and paste here the full text of the error message.
Results 1 to 12 of 12