3 <title>Quadratic Equation Solver</title>
9 error_reporting(E_ALL);
12 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
15 <h1>Quadratic Equation Solver</h1>
16 <form action=
"Quadratic.php" method=
"POST">
17 Enter the coefficients
for the Ax<sup>2</sup> + Bx +
C = 0
18 <table border=
"0" cellpadding=
"0" cellspacing=
"0">
19 <tr><td><b>A&
nbsp;</b></td>
20 <td><input name=
"A" type=
"text" size=
"8" value=
"<?php echo (isset($_POST['A'])) ? htmlentities($_POST['A']) : ''; ?>"></td>
22 <tr><td><b>
B&
nbsp;</b></td>
23 <td><input name=
"B" type=
"text" size=
"8" value=
"<?php echo (isset($_POST['B'])) ? htmlentities($_POST['B']) : ''; ?>"></td>
25 <tr><td><b>C&
nbsp;</b></td>
26 <td><input name=
"C" type=
"text" size=
"8" value=
"<?php echo (isset($_POST['C'])) ? htmlentities($_POST['C']) : ''; ?>"></td>
29 <input name=
"submit" type=
"submit" value=
"calculate"><br />
30 If A=0, the equation
is not quadratic.
35 if (isset(
$_POST[
'submit'])) {
37 echo
'The equation is not quadratic';
40 include
'PHPExcel/IOFactory.php';
52 echo
'<hr /><b>Roots:</b><br />';
55 echo
$objPHPExcel->getActiveSheet()->getCell(
'B5')->getCalculatedValue().
'<br />';
56 echo
$objPHPExcel->getActiveSheet()->getCell(
'B6')->getCalculatedValue().
'<br />';
60 echo
'<hr />Call time for Quadratic Equation Solution was '.sprintf(
'%.4f',
$callTime).
' seconds<br /><hr />';
61 echo
' Peak memory usage: '.(memory_get_peak_usage(
true) / 1024 / 1024).
' MB<br />';
< span style="color:black;"> TC</span >< span style="color:white;"> PDF</span > & nbsp
static load($pFilename)
Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution.
Set page orientation and size