Restore faz1/yol-haritasi docs (overwritten by copy); stage1 docs; G0174 new gap; stage1 25-task subset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
47
tasks_gen/eval/G0143/faulty/m4_bowl_fee_old.func.abap
Normal file
47
tasks_gen/eval/G0143/faulty/m4_bowl_fee_old.func.abap
Normal file
@@ -0,0 +1,47 @@
|
||||
FUNCTION {{p}}bowl_fee_old
|
||||
IMPORTING
|
||||
iv_lanes TYPE i
|
||||
iv_minutes TYPE i
|
||||
iv_players TYPE i
|
||||
iv_day TYPE string
|
||||
iv_start TYPE t
|
||||
iv_member TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_input.
|
||||
|
||||
CONSTANTS c_half_hour_minutes TYPE i VALUE 30.
|
||||
CONSTANTS c_lane_price TYPE decfloat34 VALUE '6.00'.
|
||||
CONSTANTS c_shoe_price TYPE decfloat34 VALUE '2.50'.
|
||||
CONSTANTS c_peak_start TYPE t VALUE '180000'.
|
||||
CONSTANTS c_peak_end TYPE t VALUE '220000'.
|
||||
CONSTANTS c_peak_factor TYPE decfloat34 VALUE '1.2'.
|
||||
CONSTANTS c_weekend_factor TYPE decfloat34 VALUE '1.15'.
|
||||
CONSTANTS c_member_factor TYPE decfloat34 VALUE '0.9'.
|
||||
CONSTANTS c_member_min_fee TYPE decfloat34 VALUE '20.00'.
|
||||
|
||||
IF iv_lanes < 1 OR iv_minutes < 1 OR iv_players < 0.
|
||||
RAISE invalid_input.
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_half_hours) = ( iv_minutes + c_half_hour_minutes - 1 ) DIV c_half_hour_minutes.
|
||||
DATA(lv_lane_fee) = iv_lanes * lv_half_hours * c_lane_price.
|
||||
|
||||
IF iv_start >= c_peak_start AND iv_start < c_peak_end.
|
||||
lv_lane_fee = lv_lane_fee * c_peak_factor.
|
||||
ENDIF.
|
||||
|
||||
IF iv_day = 'SAT' OR iv_day = 'SUN'.
|
||||
lv_lane_fee = lv_lane_fee * c_weekend_factor.
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_total) = lv_lane_fee + iv_players * c_shoe_price.
|
||||
|
||||
IF iv_member = abap_true AND lv_total >= c_member_min_fee.
|
||||
lv_total = lv_total * c_member_factor.
|
||||
ENDIF.
|
||||
|
||||
ev_fee = round( val = lv_total dec = 3 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
ENDFUNCTION.
|
||||
Reference in New Issue
Block a user