Skip to content

Instantly share code, notes, and snippets.

@magmastonealex
Created October 10, 2013 13:37
Show Gist options
  • Save magmastonealex/6918444 to your computer and use it in GitHub Desktop.
Save magmastonealex/6918444 to your computer and use it in GitHub Desktop.
Assignment 3
<html>
<head>
<style>
table{
background-color: yellow;
padding: 0px;
border-spacing:0;
}
td{
border: 1px solid black;
padding: 0px;
width: 30px;
height: 20px;
}
</style>
</head>
<body>
<table>
<?php
$upto = 7;
for($i =1; $i <=$upto; $i++ ){
echo "<tr>";
for($x=1; $x <=$upto; $x++){
$z = $x*$i;
echo "<td>$z</td>";
}
echo "</tr>";
}
?>
<table>
</body>
<?php
#a=-6t^4+ht^3+2t^2+t
$h = 70;
$m = 10;
$t = 1;
$solved = 0;
while($t <= $m){
$a=((-6)*pow($t,4))+(($h)*pow($t,3))+(2*pow($t,2))+$t;
if($a <= 0){
echo "The balloon first touches ground at hour:<br>$t";
$solved = 1;
break;
}
$t++;
}
if($solved != 1){
echo "The balloon does not touch ground in the given time.";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment