Back to DFS's Workshop Page
Back to Agenda Page


Quadratic Equation Problem I

Hardset Variables

For this problem, you are to cannibalize any available code and write a PHP script which will do the following. Using the quadratic formula, solve the equation Ax2 + Bx + C = 0.

  1. Introduce the program to the user
  2. Hardset the coefficients, e.g., $a = 1;
  3. Calculate the value of the discriminant
  4. Checking the discriminant, calculate the root(s) and print the results

Use your pseudocode as your documentation comments.


© 2007 DFStermole
Created 16 Nov 07
Last Modified 16 Nov 07