Syntax error, insert "while (Expression);" to complete DoStatement [closed]

-1

I'm doing a simple BlackJack game on JAVA Eclipse Neon. I had a problem with this loop, and I really have no idea how to fix it. I already researched, but I still have that problem, I hope someone can help me with that while and do .

do{ // Open do
    System.out.println("¿Cuánto dinero desea apostar?");
    apuesta = entrada.nextInt();
    if (apuesta < 0 || apuesta > dinero) { // Open if
        System.out.println("Su apuesta debe ser mayor a 0 y menor a " + dinero + "pesos");
    } // Close if
} // close do
    
asked by Gustavo Gallego 21.01.2017 в 20:06
source

1 answer

1

The error that the compiler generates is clear. On line 38 you must insert a while(condicion) where condicion is a boolean expression that returns true or false while returning true will make the block inside your do-while sentence always run.

Remember that the syntax of the do-while statement is as follows:

do {
//Bloque de código a ejecutar
//...
}while(condicion);
    
answered by 21.01.2017 / 20:14
source