<?phpif (isset($_GET[c]) && isset($_GET[w]) && isset($_GET['p'])){ $c = $_GET[c]/100; $bigW = $_GET[w]; $w = $_GET[w]/100; $p = $_GET[p]/100; $s = "<font color=\"#FF0000\"><b>To get a $bigW% for the quarter, you need to get a " . ((w - c - c*p)/p * 100) . "% on your midyear.</b></font><p /><p />";}else $s = "";?><html> <head> <title> Midyear Grade Calculator </title> </head> <body> <?php print $s; ?> Enter the information below to see what you should be aiming for on the final test <form action = "gcalc.php" method="get"> <table border = 0> <tr> <td> Current Grade (in %): </td> <td> <input type="text" name="c" maxlength=3>% </td> </tr> <tr> <td> Wanted Percentage (for quarter): </td> <td> <input type="text" name="w" maxlength="3">% </td> </tr> <tr> <td> Weight of final test (in %): </td> <td> <input type="text" name="p" maxlength="3">% </td> </tr> <tr> <td> </td> <td> <input type="submit" value="Calculate"> </td> </tr> </table> </form> </body></html>