A mobile computer technician uses an algorithm to determine the callout fee for a home service visit based on the duration of the job and the service zone code.
jobDuration ← USERINPUT
zoneCode ← USERINPUT
calloutFee ← 0.0
messageOne ← "Minimum time not met"
messageTwo ← "Service zone out of range"
IF zoneCode ≤ 3 AND jobDuration > 0.0 THEN
IF jobDuration > 4.5 THEN
calloutFee ← 20.0
OUTPUT calloutFee
ELSE IF jobDuration > 2.0 THEN
calloutFee ← (jobDuration * 10) + 12.0
OUTPUT calloutFee
ELSE
OUTPUT messageOne
ENDIF
ELSE
OUTPUT messageTwo
ENDIF
Using Figure 1, complete the table below.
Input value of jobDuration | Input value of zoneCode | Output |
|---|---|---|
| 5.0 | 2 | |
| 3.0 | 3 |