Guest User

Untitled

a guest
Oct 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. package silveira;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Silveira {
  6. public static void main(String[] args) {
  7. int dia, mes, ano;
  8. Scanner leia = new Scanner(System.in);
  9. System.out.print("entre com o dia:");
  10. dia = leia.nextInt();
  11. System.out.print("entre com o mes:");
  12. mes = leia.nextInt();
  13. System.out.print("entre com o ano:");
  14. ano = leia.nextInt();
  15.  
  16. if (ano <= 1900) {
  17. }
  18. if ((mes == 4) || (mes == 6) || (mes == 9) || (mes == 11)) {
  19. }
  20. if ((dia < 1) || (dia > 30)) {
  21. System.out.println("Data Inválida!");
  22. }
  23. if ((mes == 1) || (mes == 3) || (mes == 5) || (mes == 7) || (mes == 8) || (mes == 10) || (mes == 12)) {
  24. }
  25. if ((dia < 1) || (dia > 31)) {
  26. System.out.println("Data Inválida!");
  27. }
  28. if (mes == 2) {
  29. }
  30. if ((ano % 4) == 0) {
  31. }
  32. if ((dia < 1) || (dia > 29)) {
  33. System.out.println("Data Inválida!");
  34. } else if ((dia < 1) || (dia > 28)) {
  35. System.out.println("Data Inválida!");
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment