AP CSA FRQ Guide
2010 FRQ 2: APLine
Write a line class that stores equation coefficients, returns slope as a double, and tests whether a point lies on the line.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Store the three coefficients from the constructor.
- 2Avoid integer division when computing slope.
- 3Evaluate the equation for a point and compare with zero.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Stores all three coefficients as instance variables.
Both methods need access to a, b, and c.
Computes slope using double arithmetic.
Cast before division or multiply by -1.0.
Checks ax + by + c == 0.
Use all three stored coefficients.
Returns a boolean from isOnLine.
The method should not print the result.
Practice Links
