diloentutospc

DETERMINE CUANDO UN AÑO ES BISIESTO

Sep 12th, 2018
2,262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class AnoBisiesto {
  4.  
  5.     int ano;
  6.    
  7.     Scanner entrada = new Scanner(System.in);
  8.    
  9.     public void Entradaaño() {
  10.         System.out.println("Aplicación para determinar si el año es bisiesto");
  11.         System.out.print("Ingrese año a evaluar: ");
  12.         ano = entrada.nextInt();
  13.     }
  14.    
  15.     public void proceso() {
  16.         if((ano % 4 ==0) && (ano % 100 != 0 || ano % 400 == 0)) {
  17.             System.out.println(ano + " es un año bisiesto");
  18.         }else {
  19.             System.out.println(ano+ " no es un año bisiesto");
  20.         }
  21.     }
  22.    
  23.     public static void main(String[] args) {
  24.         AnoBisiesto fc = new AnoBisiesto();
  25.         fc.Entradaaño();
  26.         fc.proceso();
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment