Advertisement
LucasSousa

testando ifffff

Aug 23rd, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package testedejava1;
  2.  
  3. import java.util.*;
  4.  
  5. public class TesteDeJava1 {
  6.  
  7. public static void main (String[]args) {
  8.  
  9. Scanner input = new Scanner(System.in);
  10.  
  11. System.out.println("Qual seu nome?");
  12. String nome = input.nextLine();
  13.  
  14. int idade;
  15. System.out.println("Qual sua idade?");
  16. idade = input.nextInt();
  17.  
  18.  
  19. if(idade < 1) {
  20. System.out.println(nome + ", idade inválida.");
  21. } else if (idade < 18){
  22. System.out.println(nome + ", você é jovem.");
  23. } else if (idade == 18) {
  24. System.out.println(nome + ", não vale colocar sua idade igual a 18.");
  25. } else {
  26. System.out.println(nome + ", você é velho.");
  27. }
  28. System.out.println("\nObrigado por usar meu programa.\nxD");
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement