View Single Post
Old 08-05-2004, 08:09   #5 (permalink)
cains
Danish crap punter
 
cains's Avatar
 
Join Date: 26 Oct 2004
Location: Aarhus, DK
Age: 31
Posts: 725
Default lesson23

Hey...

The solution you have made for lesson23, When bets lose.. Then you first get 900, that it your bank now. And then you get 100, that is your winnings / lose...
Should that not be -100 instead???

I have made it like this instead:

public class Lesson2 {
public static void main(String[ ] arguments) {


int Bank = 1000;
int Bet = 100;
int Odds = 3;
int WinLose = 0;
int Winnings = 0;

if (WinLose == 0)
{
Bank = Bank - Bet;
}
else if (WinLose == 1)
{
Bank = (Bank - Bet) + (Bet * Odds);
}
System.out.println(Bank);
if (WinLose == 0)
{
Winnings = Winnings - Bet;
}
else if (WinLose == 1)
{
Winnings = (Bet * Odds) - Bet;
}
System.out.println(Winnings);
}
}

So it will show -100...

Was just wondering...

btw... sorry beeing so late out... Have been busy all week, so just started.. But i will try to catch up with the rest of you..

/ cains



Yes, you passed the test,
cains is offline