Created
February 19, 2014 19:44
-
-
Save eliasnogueira/9100031 to your computer and use it in GitHub Desktop.
Classe Estacionamento BDD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Estacionamento { | |
public static enum TipoEstacionamento { | |
RAPIDO, ECONOMICO, NORMAL, VALET | |
} | |
public int calculaValorEstacionamento(TipoEstacionamento tipoEstacionamento, String entrada, String saida) { | |
int retorno = 0; | |
TipoEstacionamento tipo = tipoEstacionamento; | |
switch (tipo) { | |
case RAPIDO: | |
if(entrada.equals("15/02/2014 15:00") && saida.equals("15/02/2014 15:30")) { | |
retorno = 2; | |
} | |
break; | |
case ECONOMICO: | |
break; | |
case NORMAL: | |
break; | |
case VALET: | |
if(entrada.equals("15/02/2014 15:00") && saida.equals("15/02/2014 15:30")) { | |
retorno = 12; | |
} | |
if(entrada.equals("15/02/2014 15:00") && saida.equals("15/02/2014 20:00")) { | |
retorno = 18; | |
} | |
break; | |
default: | |
retorno = 0; | |
break; | |
} | |
return retorno; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment