Back to DFS's Workshop Page
Back to Agenda Page


Quadratic Equation Problem II

An Interactive Solution

For this problem, you are to cannibalize any available code and write a PHP script which can be run from the Command Line. It should ask the user for the coefficients of the equation Ax2 + Bx + C = 0. Using the quadratic formula, follow the pseudocode below.

  1. Introduce the program to the user
  2. Prompt the user to input the coefficients
  3. Calculate the value of the discriminant
  4. Checking the discriminant, calculate the root(s) and print the results

Click here to see an HTML/PHP solution to this problem.


© 2005-2007 DFStermole
Created 30 Oct 05
Last Modified 16 Nov 07