Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
61
tasks_gen/train/G1055/spec.md
Normal file
61
tasks_gen/train/G1055/spec.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# 1. Goal
|
||||
A community garden association rents garden plots to its tenants and charges an
|
||||
annual rent for each plot. The billing program of the association calls one
|
||||
calculation for each plot. The program needs the rent and one reason code for
|
||||
each plot.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- The class {{P}}GARDEN_RENT does not exist. Create it in package $TMP.
|
||||
- The billing program calls the class for each plot. It passes the plot type, the
|
||||
area of the plot in square metres, a flag that tells if the plot has a water
|
||||
connection, and a flag that tells if the tenant is a member of the association.
|
||||
|
||||
# 4. Contract
|
||||
- Create the class {{P}}GARDEN_RENT in package $TMP.
|
||||
- The class is public and final. It has a public constructor without parameters.
|
||||
- Do not add other public methods.
|
||||
- Define these public types:
|
||||
- TY_PLOT_TYPE: type c, length 4.
|
||||
- TY_REASON: type c, length 10.
|
||||
- TY_AMOUNT: type p, length 8, 2 decimals.
|
||||
- TY_RESULT: structure with the components REASON (type TY_REASON) and RENT
|
||||
(type TY_AMOUNT).
|
||||
- Define the public constant structure C_REASON with the components OK, PLOT and
|
||||
AREA. The values are 'OK', 'PLOT' and 'AREA'.
|
||||
- The class has the public method CALCULATE with these parameters:
|
||||
- importing IV_PLOT_TYPE, type TY_PLOT_TYPE.
|
||||
- importing IV_AREA, type i.
|
||||
- importing IV_WATER, type abap_bool.
|
||||
- importing IV_MEMBER, type abap_bool.
|
||||
- returning RS_RESULT, type TY_RESULT.
|
||||
|
||||
# 5. Business rules
|
||||
Apply the rules in this sequence. The first rule that fails decides the result.
|
||||
1. Convert the plot type to upper case.
|
||||
2. The plot type must be STD, PREM or BED. If not, return the reason PLOT and the
|
||||
rent 0.00.
|
||||
3. The area must be between 10 and 500 square metres. Both limits are included.
|
||||
If not, return the reason AREA and the rent 0.00.
|
||||
4. The rent per square metre depends on the plot type: STD = 0.35, PREM = 0.60,
|
||||
BED = 0.90.
|
||||
5. The rent is the area multiplied by the rent per square metre.
|
||||
6. If the plot has a water connection, add 12.00.
|
||||
7. If the tenant is a member of the association, subtract 15 percent of that
|
||||
amount.
|
||||
8. Round the rent to two decimals. Round half up: 22.695 becomes 22.70.
|
||||
9. The rent must be at least 10.00. If it is less, use 10.00.
|
||||
10. Return the reason OK and the rent.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Coding standards: Clean ABAP. Method length below 40 statements. No global
|
||||
variables. No comment that restates the code.
|
||||
- Out of scope: do not create other objects and do not use a database table.
|
||||
|
||||
# 7. Acceptance
|
||||
- The class is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write your own ABAP Unit tests for the class.
|
||||
Reference in New Issue
Block a user