1
Good evening. I’m doing a college job on an ATM and I’m having a little doubt. I’m creating a do
to make the ATM repeat menu, but before the user enters the box, it will set a value for the accounts, because the balance variable is set to 0. After this, it will be released to the cashier menu. But after setting the value the value it keeps repeating the message "teste"
. I’d like some help.
Here’s the code:
do{
if(saldoCC<=0 && saldoCP<=0) {
System.out.println("-----------------------------------------------------------");
System.out.println("Saldo zerado em ambas as contas!");
System.out.println("Para utilizar o caixa eletrônico sete o valor!");
System.out.println("-----------------------------------------------------------");
System.out.println("DIGITE O VALOR PARA REPOR O SALDO");
System.out.println("-----------------------------------------------------------");
System.out.print("Saldo da CONTA CORRENTE: R$");
saldoCC = teclado.nextFloat();
System.out.print("Saldo da CONTA POUPANÇA: R$");
saldoCP = teclado.nextFloat();
System.out.println("-----------------------------------------------------------");
System.out.println("SALDO SETADO!");
System.out.println("Conta Corrente: R$"+ saldoCC);
System.out.println("Conta Poupança: R$"+ saldoCP);
}else{
System.out.println("teste");
}
}while(op != 3);
Good afternoon! thanks for the help, I put a break; after System.out.println("test"); and it worked! this repeating as I wanted!
– Diego Souza