Concept
What kinds of user input can cause problems in a quadratic-roots program?
ComputerScienceOne / Computing Quadratic Roots
"Finally, think about the possible input a user could provide that may cause problems for this program. For example:\n\n• What if the user entered zero for a?\n\n• What if the user entered some combination such that b^2 < 4ac?\n\n• What if the user entered non-numeric values?\n\n• For the command line argument version, what if the user provided less than three arguments? Or more?\n\nHow might we prevent the consequences of such bad input? How might we handle the event that a user enters bad input and how do we communicate these errors to the user? To begin to resolve these issues, we’ll need conditionals."
Related Ideas
- How can quadratic-equation inputs be provided as command-line arguments?ComputerScienceOne · Computing Quadratic Roots
- How can conditionals handle invalid inputs and special cases in a quadratic roots program?ComputerScienceOne · Quadratic Roots Revisited
- How can conditionals handle invalid inputs and special cases in a quadratic roots program?ComputerScienceOne · Quadratic Roots Revisited
- How does the Java quadratic roots program check errors and calculate its roots?ComputerScienceOne · Quadratic Roots Revisited
- How can conditionals handle invalid and special cases in a quadratic roots program?ComputerScienceOne · Quadratic Roots Revisited
- How can a C program compute the roots of a quadratic equation?ComputerScienceOne · Computing Quadratic Roots
- How can a quadratic roots function return error codes?ComputerScienceOne · Error Handling By Design
- How can the return value communicate errors when roots are passed by reference?ComputerScienceOne · Quadratic Roots