Search:

Type: Posts; User: Laxman2809

Search: Search took 0.09 seconds.

  1. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    this seems to get rid of the issue of subtracting it twice, but my thought is that its not/ I am not coding it right to enact the method to b1.withdraw(wager) and b2.withdraw(wager) which i thought...
  2. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Yes but now it is subtracting double the wager i think it is cause I am taking the wager twice but I don't know how to fix it
  3. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    reducing the balance by the wager and then returning the balance with the wager subtracted

    public int withdraw(int wager) {
    return balance=balance - (wager);
    }
  4. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Correct I was under the impression that using

    b1.withdraw(wager1,wager1);
    would be for account 1 and subtracting player 1 wager that he entered


    b2.withdraw(wager2,wager2);

    would be for...
  5. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    I would like the method withdraw to subtract the wager from the balance and return me that int. it has to do this for 2 different bank accounts keeping the 2 balances separate



    //Wager...
  6. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Alright so how would you call withdraw after the balance has been subtracted by the wager?
  7. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    I hate to ask it but could you explain what you mean my recursive.
  8. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Exception in thread "main" java.lang.StackOverflowError
    at Bankaccount.withdraw(Bankaccount.java:25)

    for when I run
  9. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Alright so solved some of those issues now on how to subtract the wager from the balance entered by the user it is saing method withdraw is not applicable for the argument int, int



    import...
  10. Replies
    24
    Views
    1,869

    Re: Dice Wagering Game new to Multiple Classes

    Alright so no error really just having issues making it do as i would like
    Now I have it asking for 1st name but I can't get it to ask for the 2nd name


    import java.util.Scanner;


    public...
  11. Replies
    24
    Views
    1,869

    Dice Wagering Game new to Multiple Classes

    Alright so I have a hw on multiple classes and I am having trouble with getting input from 1 to another. Now I don't know what the best way to do this so I am having the class ask for the input(error...
Results 1 to 11 of 11