Chapter
Computing Quadratic Roots
From ComputerScienceOne by Dr Chris Bourke
Concepts
- How can a PHP program prompt for the coefficients of a quadratic polynomial?
"Some programs require the user to enter multiple inputs. The prompt-input process can be repeated. In this example, consider asking the user for the coefficients, a, b, c to a quadratic polynomial, a
- How does PHP compute the roots of a quadratic equation?
"We need to take care that we correctly adapt the formula so it accurately reflects the order of operations. We also need to use the math library’s square root function.\n\n$root1 = (-$b + sqrt($b*$b
- What kinds of user input can cause problems in a quadratic-roots program?
"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 combin