Server IP : 172.16.15.8 / Your IP : 52.14.178.241 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/tmrandall/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!-- Assign2Que2sessionform.php Author: Taylor Randall Instructor: Dr. Wang Due: Sunday Feb. 17, 2023 --> <CENTER> <FONT color = blue> <p> <H2> The solution for ax<sup>2</sup> + bx + c = 0 </H2> <HR> <?php $a = $_POST['a']; $b = $_POST['b']; $c = $_POST['c']; print "a = $a, b = $b, c = $c<P>"; $d = $b*$b - 4*$a*$c; if($d < 0) print "No Real Root"; else if ($d == 0) { $x = -$b/(2*$a); print "The root is: $x<br>"; } else { $x1 = (-$b + sqrt($d))/(2.0 * $a); $x2 = (-$b - sqrt($d))/(2.0 * $a); $root1 = number_format($x1,1); $root2 = number_format($x2,1); print "The first root is: $root1<br>"; print "The second root is: $root2"; } ?> </FONT> </CENTER> <A HREF=http://zeus.vwu.edu/~tmrandall/Assign2Ques2login.html> Back to Form </A> | <A HREF=http://zeus.vwu.edu/~tmrandall/> Course Home </A>