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...
Type: Posts; User: Laxman2809
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...
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
reducing the balance by the wager and then returning the balance with the wager subtracted
public int withdraw(int wager) {
return balance=balance - (wager);
}
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...
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...
Alright so how would you call withdraw after the balance has been subtracted by the wager?
I hate to ask it but could you explain what you mean my recursive.
Exception in thread "main" java.lang.StackOverflowError
at Bankaccount.withdraw(Bankaccount.java:25)
for when I run
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...
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...
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...