Created
February 16, 2017 23:43
-
-
Save Rafael11j/08a499a228dc33940a84d91c351a2bab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package exercicícios; | |
import java.util.Scanner; | |
public class Exercício05 { | |
public static void main(String[] args) { | |
Scanner abre = new Scanner(System.in); | |
double km, consumo; | |
int litros; | |
System.out.println("Digite a quantidade de quilometros rodados: "); | |
km = abre.nextDouble(); | |
System.out.println("Digite a quantidade de litros de combustível colocados: "); | |
litros = abre.nextInt(); | |
consumo = (double) (km / litros); | |
System.out.println("O consumo é: " + consumo); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment