estephane

atividade

Mar 11th, 2020
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. Scanner teclado = new Scanner(System.in);
  2.         int km,litro;
  3.         double consumo;
  4.         String resp = "s";
  5.         do{
  6.         System.out.println("Digite a quilometragem:");
  7.         km = teclado.nextInt();
  8.         System.out.println("Digite a quantidade de combustível:");
  9.         litro = teclado.nextInt();
  10.         System.out.println("Deseja continuar: [S/N]");
  11.         }while(resp.toUpperCase().equals("S"));
  12.         consumo = (float) km/litro;
Advertisement
Add Comment
Please, Sign In to add comment