Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
49
tasks_gen/train/G1096/faulty/m4_adopt_review.func.abap
Normal file
49
tasks_gen/train/G1096/faulty/m4_adopt_review.func.abap
Normal file
@@ -0,0 +1,49 @@
|
||||
FUNCTION {{p}}adopt_review
|
||||
IMPORTING
|
||||
iv_species TYPE string
|
||||
iv_age_years TYPE i
|
||||
iv_housing TYPE string
|
||||
iv_garden TYPE abap_bool
|
||||
iv_pets TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE decfloat34
|
||||
ev_visit_day TYPE string
|
||||
RAISING
|
||||
{{p}}cx_adopt_reject.
|
||||
|
||||
IF iv_age_years < 18.
|
||||
RAISE EXCEPTION NEW {{p}}cx_adopt_reject( iv_reason = 'TOO_YOUNG' ).
|
||||
ENDIF.
|
||||
|
||||
DATA lv_deposit TYPE decfloat34.
|
||||
CASE iv_species.
|
||||
WHEN 'DOG'.
|
||||
lv_deposit = 150.
|
||||
WHEN 'CAT'.
|
||||
lv_deposit = 80.
|
||||
WHEN 'RABBIT'.
|
||||
lv_deposit = 40.
|
||||
WHEN OTHERS.
|
||||
RAISE EXCEPTION NEW {{p}}cx_adopt_reject( iv_reason = 'UNKNOWN_SPECIES' ).
|
||||
ENDCASE.
|
||||
|
||||
IF iv_species = 'DOG' AND iv_housing = 'FLAT' AND iv_garden = abap_false.
|
||||
RAISE EXCEPTION NEW {{p}}cx_adopt_reject( iv_reason = 'NO_GARDEN' ).
|
||||
ENDIF.
|
||||
|
||||
IF iv_pets > 2.
|
||||
RAISE EXCEPTION NEW {{p}}cx_adopt_reject( iv_reason = 'TOO_MANY_PETS' ).
|
||||
ENDIF.
|
||||
|
||||
IF iv_pets > 0.
|
||||
lv_deposit = lv_deposit + 12.
|
||||
ENDIF.
|
||||
ev_deposit = lv_deposit.
|
||||
|
||||
IF iv_garden = abap_false.
|
||||
ev_visit_day = 'SAT'.
|
||||
ELSE.
|
||||
ev_visit_day = 'WED'.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user