Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String registarDonacion(int edad, String sexo, double peso, String tipoSangre, String rh, boolean padeceEnfermedad)
- {
- if ((tipoSangre.equals(TipoSangre.TIPO_A) && rh.equals(TipoSangre.RH_N)) || (tipoSangre.equals(TipoSangre.TIPO_B) && tipoSangre.equals(TipoSangre.RH_N)) || (tipoSangre.equals(TipoSangre.TIPO_O) && tipoSangre.equals(TipoSangre.RH_P)) || (tipoSangre.equals(TipoSangre.TIPO_O) && tipoSangre.equals(TipoSangre.RH_N))){
- if( edad >= 18 && edad <= 65){
- if (sexo == FEMENINO){
- if ( peso >= 50){
- if (donadorPadeceEnfermdad() == false){
- return DONACION;
- }
- else {
- return ERROR_DONADOR;
- }
- }
- else {
- return ERROR_DONADOR;
- }
- }
- else if ( sexo == MASCULINO){
- if ( peso >= 53){
- if (donadorPadeceEnfermdad() == false){
- return DONACION;
- }
- else {
- return ERROR_DONADOR;
- }
- }
- }
- else {
- return ERROR_DONADOR;
- }
- }
- return ERROR_DONADOR;
- }
- else { return ERROR_TIPO_SANGRE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement