Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package es.unileon.prg.date;
- public class MainDate {
- public static void main(String[] args) {
- Date today;
- try {
- System.out.println("Dame un dia");
- int day = Teclado.readInteger();
- System.out.println("Dame un mes");
- int month = Teclado.readInteger();
- System.out.println("Dame un año");
- int year = Teclado.readInteger();
- today = new Date(day, month, year);
- System.out.println(today.toString());
- System.out.println(today.stringVersionDate()+"\n");
- System.out.println("El nombre del mes es: "+ today.printNameOfMonth());
- System.out.println("La estacion del año en ese mes es: "+ today.printSeason());
- System.out.println("Los meses restantes hasta fin de año son: "+ today.monthsLeft());
- System.out.println("Los días restantes del mes son: "+ today.daysLeft());
- System.out.println(today.monthsWithSameDays());
- System.out.println("Los dias que han pasado desde principio del año son: "+today.numberDaysFromBeginings());
- System.out.println("Numero de intentos para acertar la fecha con la fecha random (do/while): "+ today.attemptsRandom());
- System.out.println("Numero de intentos para acertar la fecha con la fecha random (while): "+ today.attemptsRandomWhile());
- System.out.println("El dia de la semana de ese dia es: "+ today.dayOfTheWeek());
- } catch (DateException e) {
- System.out.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement