Guest User

Untitled

a guest
Apr 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // Metodo que calcula una nueva Fecha que sea el dia siguiente a this
  2. // Ejemplos: 10/10/2010 -> 11/10/2010. 30/11/2010 -> 31/10/2010. 31/12/2011 -> 1/1/2012
  3. // ATENCION: En este metodo NO SE PERMITE UTILIZAR LOS SIGUIENTES METODOS:
  4. // · EsDeUnAnioBisiesto
  5. // · NumeroDeDiasDelMes
  6. // · NumeroDeDiasDelMes
  7. // · Si la fecha this es incorrecta devuelve la misma, en caso contrario devuelve la fecha del dia siguiente.
  8. Fecha DiaSiguiente ()
  9. {
  10. if (this.EsCorrecta()){
  11. this.d=(this.d+1);
  12. if (!(this.EsCorrecta())){
  13. this.d=1;
  14. this.m=(this.m+1);
  15. if (!(this.EsCorrecta())){
  16. this.m=1;
  17. this.a=(this.a+1);
  18. }
  19. }
  20. } else {
  21. return this ;
  22. }
  23. }
Add Comment
Please, Sign In to add comment