46 lines
1.9 KiB
Markdown
46 lines
1.9 KiB
Markdown
# 1. Goal
|
|
Calculate the fee of one driving lesson for a driving school. The lesson
|
|
booking program calls one function module for each completed lesson. The
|
|
function module must have the same interface as the sample lesson module,
|
|
because the booking program calls all lesson modules in the same way.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Function group {{P}}FG_DRIVE exists in package $TMP.
|
|
- Function module {{P}}DRV_SAMPLE exists in this group. It is the sample
|
|
lesson module. Its interface is the interface that all lesson modules must
|
|
use.
|
|
|
|
# 4. Contract
|
|
- Create the function module {{P}}DRV_FEE in function group {{P}}FG_DRIVE.
|
|
- Use exactly the interface of {{P}}DRV_SAMPLE: the same parameter names,
|
|
kinds and types, and the same exceptions.
|
|
|
|
# 5. Business rules
|
|
1. If iv_minutes is less than 1, raise the exception INVALID_MINUTES. This
|
|
rule applies before all other rules.
|
|
2. The rate of one lesson minute depends on the vehicle: CAR 1.20, TRUCK
|
|
2.50, MOTORCYCLE 0.90.
|
|
3. If iv_vehicle is not one of these three values, the fee is 0 and the block
|
|
flag is false. Do not raise an exception. This rule also applies when
|
|
iv_minutes is more than 120.
|
|
4. The fee is the rate multiplied by iv_minutes.
|
|
5. The lesson type adds a surcharge to this amount: NIGHT 25 %, MOTORWAY
|
|
40 %. All other lesson types have no surcharge.
|
|
6. Round the fee half up to 2 decimals.
|
|
7. The minimum fee of one lesson is 15.00.
|
|
8. Set the block flag to true if iv_minutes is more than 120. Set the block
|
|
flag to false in all other cases.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.40 SP05. Use only syntax that this release supports.
|
|
- Coding standards: Clean ABAP. No ATC priority 1 or priority 2 findings.
|
|
- Out of scope: do not change {{P}}DRV_SAMPLE.
|
|
|
|
# 7. Acceptance
|
|
- The function module is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests for the function module in a global test class.
|