1
I need to carry out a search and I wrote the following code to carry it out, but without success. I wonder if I’m doing it properly.
public void AcessoCC()
{
int id = 0;
Integer infoConta;
System.out.println("Informe o número da conta: ");
sc = new Scanner(System.in);
infoConta = sc.nextInt();
for(int i = 0; i < clienteCC.length; i++)
{
if (clienteCC[i].getNumConta() == infoConta)
{
id = i;
}
}
if (clienteCC[id].getCliente() != null)
{
System.out.println("Cliente: " + clienteCC[id].getCliente());
System.out.println("Conta número: " + clienteCC[id].getNumConta());
System.out.println("Cliente: " + clienteCC[id].getSaldo());
System.out.println("Limite Disponivel: "
+ clienteCC[id].getLimite());
System.out.println("Limite Disponivel: "
+ clienteCC[id].getLimiteTotal());
do
{
System.out.println("Deseja: 'S'aque, 'D'eposito, 'V'er saldo"
+ " ou 'E'ncerrar");
}while(op != 'T');
}else
{
System.out.println("Dados não localizados");
}
}
What this code should do that it’s not doing?
– user28595
Could show how the objects of clienteCC ? if possible edit your question and add the Customer Object class! Could you tell us what happens? What doesn’t work? Thanks!
– Thiago Luiz Domacoski