Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AnoBisiesto {
- int ano;
- Scanner entrada = new Scanner(System.in);
- public void Entradaaño() {
- System.out.println("Aplicación para determinar si el año es bisiesto");
- System.out.print("Ingrese año a evaluar: ");
- ano = entrada.nextInt();
- }
- public void proceso() {
- if((ano % 4 ==0) && (ano % 100 != 0 || ano % 400 == 0)) {
- System.out.println(ano + " es un año bisiesto");
- }else {
- System.out.println(ano+ " no es un año bisiesto");
- }
- }
- public static void main(String[] args) {
- AnoBisiesto fc = new AnoBisiesto();
- fc.Entradaaño();
- fc.proceso();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment