Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner teclado = new Scanner(System.in);
- int km,litro;
- double consumo;
- String resp = "s";
- do{
- System.out.println("Digite a quilometragem:");
- km = teclado.nextInt();
- System.out.println("Digite a quantidade de combustível:");
- litro = teclado.nextInt();
- System.out.println("Deseja continuar: [S/N]");
- }while(resp.toUpperCase().equals("S"));
- consumo = (float) km/litro;
Advertisement
Add Comment
Please, Sign In to add comment