I have a doubt I have executed this program in which in netbeans it makes a judgment that if money is less than total it leaves cantidad no suficiente
and, if you re-enter it, and this time it is enough, then the invoice will come out .
I know how to run it by java, but I do not know how this same procedure would be done in a JFrame
with windows.
For example, if you gave a price in a TextField
, this would be money like this raised in the if, and total would be another TextField
with another amount.
if (dinero< total){
System.out.println("el dinero es INSUFICIENTE.");
System.out.println("\n si desea cambiar la cantidad de dinero digite CORREGIR, sino no lo desea digite CANCELAR");
respuesta= leer.next();
if(respuesta.equalsIgnoreCase("corregir")){
option= true;
}else{
if(respuesta.equalsIgnoreCase("cancelar")){
System.out.println("pedido cancelado.");
option=false;
}else{
System.out.println("el pedido fue cancelado.");
}
}
}
}while(money<total && option!= false);
//--devuelta--//
double devuelta;
if (money>= total){
devuelta= total-money;
System.out.println("Restaurante el Mirador:");
System.out.println("FACTURA:");