Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
92
tasks_gen/eval/G0138/seed/cake_pricer.clas.abap
Normal file
92
tasks_gen/eval/G0138/seed/cake_pricer.clas.abap
Normal file
@@ -0,0 +1,92 @@
|
||||
CLASS {{p}}cake_pricer DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_price TYPE p LENGTH 8 DECIMALS 2.
|
||||
TYPES ty_filling TYPE c LENGTH 1.
|
||||
TYPES ty_decoration TYPE c LENGTH 1.
|
||||
|
||||
METHODS calculate_price
|
||||
IMPORTING iv_size TYPE i
|
||||
iv_layers TYPE i
|
||||
iv_filling TYPE ty_filling
|
||||
iv_decoration TYPE ty_decoration
|
||||
iv_express TYPE abap_bool
|
||||
RETURNING VALUE(rv_price) TYPE ty_price.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}cake_pricer IMPLEMENTATION.
|
||||
METHOD calculate_price.
|
||||
" legacy implementation, one long method
|
||||
DATA lv_size TYPE i.
|
||||
DATA lv_layers TYPE i.
|
||||
DATA lv_total TYPE ty_price.
|
||||
DATA lv_fee TYPE ty_price.
|
||||
DATA lv_amount TYPE ty_price.
|
||||
DATA lv_rate TYPE ty_price.
|
||||
DATA lv_old_check TYPE i.
|
||||
|
||||
lv_total = '12.00'.
|
||||
lv_size = iv_size.
|
||||
IF lv_size < 16.
|
||||
lv_size = 16.
|
||||
ENDIF.
|
||||
IF lv_size > 20.
|
||||
lv_rate = '0.80'.
|
||||
lv_fee = ( lv_size - 20 ) * lv_rate.
|
||||
lv_total = lv_total + lv_fee.
|
||||
ENDIF.
|
||||
lv_layers = iv_layers.
|
||||
IF lv_layers < 1.
|
||||
lv_layers = 1.
|
||||
ENDIF.
|
||||
IF lv_layers > 1.
|
||||
lv_rate = '4.50'.
|
||||
lv_fee = ( lv_layers - 1 ) * lv_rate.
|
||||
lv_total = lv_total + lv_fee.
|
||||
ENDIF.
|
||||
IF iv_filling = 'V'.
|
||||
lv_amount = '3.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSEIF iv_filling = 'C'.
|
||||
lv_amount = '4.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSEIF iv_filling = 'F'.
|
||||
lv_amount = '5.50'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSEIF iv_filling = 'N'.
|
||||
lv_amount = '0.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSE.
|
||||
lv_amount = '3.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ENDIF.
|
||||
IF iv_decoration = 'F'.
|
||||
lv_amount = '6.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSEIF iv_decoration = 'P'.
|
||||
IF lv_size >= 24.
|
||||
lv_amount = '9.50'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSE.
|
||||
lv_amount = '0.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ENDIF.
|
||||
ELSEIF iv_decoration = 'S'.
|
||||
lv_amount = '12.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ELSE.
|
||||
lv_amount = '0.00'.
|
||||
lv_total = lv_total + lv_amount.
|
||||
ENDIF.
|
||||
IF iv_express = abap_true.
|
||||
lv_rate = '1.25'.
|
||||
lv_fee = lv_total * lv_rate.
|
||||
lv_total = lv_fee.
|
||||
ENDIF.
|
||||
lv_amount = '15.00'.
|
||||
IF lv_total < lv_amount.
|
||||
lv_total = lv_amount.
|
||||
ENDIF.
|
||||
rv_price = lv_total.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user