Free practice · numeric · easy
Practice
Calculate a return value
A function subtotal(price, quantity) returns price * quantity. What does subtotal(6.5, 4) return?
Function contract trace
A caller supplies values and receives one defined result
- ContractDefine inputs, output, and failures
- ArgumentsEvaluate supplied values
- ParametersBind local names
- BodyRun focused local logic
- ReturnSend the result to the caller
- TestCheck the public contract
Keep argument evaluation, parameter binding, local state, return behavior, and external side effects visible at the function boundary.