Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
67
tasks_gen/train/G1142/seed/hut_fee.func.abap
Normal file
67
tasks_gen/train/G1142/seed/hut_fee.func.abap
Normal file
@@ -0,0 +1,67 @@
|
||||
FUNCTION {{p}}hut_fee
|
||||
IMPORTING
|
||||
iv_guest_type TYPE string
|
||||
iv_nights TYPE i
|
||||
iv_member TYPE abap_bool
|
||||
iv_breakfast TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_nights.
|
||||
|
||||
* Fee calculation of the alpine hut Alpenrose.
|
||||
* Written in 2009. It works, so nobody touched it since then.
|
||||
|
||||
DATA: lv_type TYPE string,
|
||||
lv_rate TYPE p LENGTH 8 DECIMALS 2,
|
||||
lv_room TYPE p LENGTH 10 DECIMALS 2,
|
||||
lv_bf TYPE p LENGTH 10 DECIMALS 2,
|
||||
lv_price TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
ev_fee = 0.
|
||||
lv_type = iv_guest_type.
|
||||
TRANSLATE lv_type TO UPPER CASE.
|
||||
lv_price = '9.50'.
|
||||
|
||||
IF iv_nights <= 0.
|
||||
RAISE invalid_nights.
|
||||
ELSE.
|
||||
IF lv_type = 'ADULT'.
|
||||
lv_rate = '28.00'.
|
||||
IF iv_member = 'X'.
|
||||
lv_rate = lv_rate / 2.
|
||||
ENDIF.
|
||||
ELSEIF lv_type = 'CHILD'.
|
||||
lv_rate = '14.00'.
|
||||
IF iv_member = 'X'.
|
||||
lv_rate = lv_rate / 2.
|
||||
ENDIF.
|
||||
ELSEIF lv_type = 'DOG'.
|
||||
lv_rate = '5.00'.
|
||||
ELSE.
|
||||
lv_rate = '28.00'.
|
||||
IF iv_member = 'X'.
|
||||
lv_rate = lv_rate / 2.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
lv_room = lv_rate * iv_nights.
|
||||
|
||||
IF iv_nights >= 7.
|
||||
lv_room = lv_room * 80 / 100.
|
||||
ELSEIF iv_nights >= 3.
|
||||
lv_room = lv_room * 90 / 100.
|
||||
ENDIF.
|
||||
|
||||
lv_bf = 0.
|
||||
IF iv_breakfast = 'X'.
|
||||
IF lv_type = 'ADULT' OR lv_type = 'CHILD'.
|
||||
lv_bf = lv_price * iv_nights.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
lv_room = lv_room + lv_bf.
|
||||
ev_fee = lv_room.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user