Build a function from context by determining an explicit formula, recursive rule, or calculation process.
Build a context function and evaluate it at a given input
Problem
A taxi ride costs \(\$4\) plus \(\$3~\text{per}~\text{mile}\). Write the cost function \(C(m)\) and evaluate \(C(8)\).
Big Picture
What this problem is really about
Build the general cost model before evaluating the requested trip. We’ll define mileage as the input, keep the one-time fee as a constant, and multiply only the per-mile rate by the distance. After the rule is structurally correct, substitution and unit tracking produce a fare that can be checked against the fixed-plus-variable context.
Inside Gozunta
Turn the preview into practice.
More than a preview
Gozunta lets you study this problem—and more than 10,000 others.
Create targeted learning sessions, use hints, check your answer, read the walkthrough, watch the video, print the work, and track your progress.