Structure of JAVA error

Asked

Viewed 33 times

0

Someone could help me, example at the end of the code has the option for the person to type YES or NO, as they would for if the person typed another word, appeared a message saying that is Yes or No and returned the option for the person to try again.

        valorTotalDoDia = valorTotalDoDia + valorCompra;
        System.out.println("♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎");
        System.out.println("O total do pedido deu: R$ " + valorCompra);
        System.out.println("♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎♦︎");
        z.clear();
        valorCompra = 0;
        System.out.println("Deseja finalizar o dia de trabalho ? ");
        fecharSistema = input.next("Sim para sair e Não para ficar");
        if (("Sim".equals(fecharSistema)) || ("sim".equals(fecharSistema))) {
            System.out.println("O valor total de vendas do dia é: R$ " + valorTotalDoDia);
            dia = false;
        } else {
        }

    }
}

}

  • 4

    Ever heard of looping? He is the answer to your question.

  • AA Thanks, thank you very much !!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.