2017-02-22

Feb 22 In-Class Exercise.

Hey Everyone,
Post your answers to the Feb 22 In-Class Exercise here.
Best, Chris
Hey Everyone, Post your answers to the Feb 22 In-Class Exercise here. Best, Chris

-- Feb 22 In-Class Exercise
David Lerner
<!DOCTYPE html>
	<head>
		<title>Favorite Songs</title>
		<meta charset="utf-8" />
		<style type="text/css">
		table {
			border: 3mm dashed;
		}
		th, td {
			padding: 3px;
		}
		</style>
	</head>
	<body>
		<?php
		echo "<h1>Favorite Songs</h1>\n";
		$favorites = [["Song1", "Singer1", 2001], 
					["Song2", "Singer2", 2002], 
					["Song3", "Singer3", 2003], 
					["Song4", "Singer4", 2004], 
					["Song5", "Singer5", 2005]];
		echo "<table>\n";
		echo "<tr><th></th><th>Song</th><th>Singer</th><th>Year</th></tr>\n";
		foreach($favorites as $key => $song){
			$rank = $key + 1;
			echo "<tr><th>$rank</th>";
			foreach($song as $var){
				echo "<td>$var</td>";
			};
			echo "</tr>\n";
		};
		echo "</table>\n";
		?>
	</body>
</html>
(Edited: 2017-02-22)
'''David Lerner''' <!DOCTYPE html> <head> <title>Favorite Songs</title> <meta charset="utf-8" /> <style type="text/css"> table { border: 3mm dashed; } th, td { padding: 3px; } </style> </head> <body> <?php echo "<h1>Favorite Songs</h1>\n"; $favorites = [["Song1", "Singer1", 2001], ["Song2", "Singer2", 2002], ["Song3", "Singer3", 2003], ["Song4", "Singer4", 2004], ["Song5", "Singer5", 2005]]; echo "<table>\n"; echo "<tr><th></th><th>Song</th><th>Singer</th><th>Year</th></tr>\n"; foreach($favorites as $key => $song){ $rank = $key + 1; echo "<tr><th>$rank</th>"; foreach($song as $var){ echo "<td>$var</td>"; }; echo "</tr>\n"; }; echo "</table>\n"; ?> </body> </html>

-- Feb 22 In-Class Exercise
Rohan Kumar
 <!DOCTYPE html>
 <html>
 <head>
     <title>Favorite Songs</title>
     <meta charset="utf-8">
     <style>
         table, td, th {
             border: 3mm dashed black
         }
 
         th {
             font-size: 18pt;
         }
 
         td {
             font-size: 14pt;
         }
     </style>
 </head>
 <body>
 <?php
 echo "<h1>Favorite Song</h1>";
 
 echo "<table>";
 
 echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>";
 
 $arr = [["Take On Me", "A-ha", "1984"], ["Going the Distance", "Bill Conti", "1976"],
     ["Beat It", "Michael Jackson", "1982"], ["Africa", "Toto", "1982"],
     ["Never Gonna Give You Up", "Rick Ashley", "1987"]];
 
 foreach ($arr as $var) {
     echo "<tr><td>$var[0]</td><td>$var[1]</td><td>$var[2]</td></tr>";
 }
 
 echo "</table>";
 ?>
 </body>
 </html>
(Edited: 2017-02-22)
Rohan Kumar <!DOCTYPE html> <html> <head> <title>Favorite Songs</title> <meta charset="utf-8"> <style> table, td, th { border: 3mm dashed black } th { font-size: 18pt; } td { font-size: 14pt; } </style> </head> <body> <?php echo "<h1>Favorite Song</h1>"; echo "<table>"; echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>"; $arr = [["Take On Me", "A-ha", "1984"], ["Going the Distance", "Bill Conti", "1976"], ["Beat It", "Michael Jackson", "1982"], ["Africa", "Toto", "1982"], ["Never Gonna Give You Up", "Rick Ashley", "1987"]]; foreach ($arr as $var) { echo "<tr><td>$var[0]</td><td>$var[1]</td><td>$var[2]</td></tr>"; } echo "</table>"; ?> </body> </html>

-- Feb 22 In-Class Exercise
Jack Wanke (008988187)
<html>
<head>
<title>Favorite Songs</title>
</head>
<body>
<?php 
echo "<h1>Favorite Songs</h1>";
$arr = ['human music by Earthlings (2000)', 
'song2 by Earthlings (2000)', 'song3 by Earthlings (2000)', 
'song4 by Earthlings (2000)', 'song5 by Earthlings (2000)']
echo "<table>";
foreach($arr as $item){
	echo "<tr>$item</tr>";
} echo "</table>"; ?> </body> </html>
(Edited: 2017-02-22)
Jack Wanke (008988187) <pre> <html> <head> <title>Favorite Songs</title> </head> <body> <?php echo "<h1>Favorite Songs</h1>"; $arr = ['human music by Earthlings (2000)', 'song2 by Earthlings (2000)', 'song3 by Earthlings (2000)', 'song4 by Earthlings (2000)', 'song5 by Earthlings (2000)'] echo "<table>"; foreach($arr as $item){ echo "<tr>$item</tr>"; } echo "</table>"; ?> </body> </html> </pre>

-- Feb 22 In-Class Exercise
<!DOCTYPE html>
<html>
	<head>
		<title>Favorite Songs</title>
		<style type="text/css">
		table {
			border: 3mm dashed;
		}
		</style>
	</head>
	<body> 
  <?php
	echo "<h1>Favorite Songs</h1>";
	$songs = ["Awaken - Disturbed" => 2007, 
				"Alive - Disturbed" => 2008, 
				"Indestructible - Disturbed" => 2011,
				"Welcome to The Jungle - GNR" => 1970,
				"Animal - Disturbed" => 2012]; 
 
	echo "<table>";
	echo "<tr><th>Song/Artist</th><th>Year</th></tr>";
	foreach($songs as $key => $value) {
		echo "<tr><td>$key</td><td>$value</td></tr>";
	}
	echo "</table>";
?>    
	</body>
</html>    (Edited: 2017-02-22)
<pre> <!DOCTYPE html> <html> <head> <title>Favorite Songs</title> <style type="text/css"> table { border: 3mm dashed; } </style> </head> <body> <?php echo "<h1>Favorite Songs</h1>"; $songs = ["Awaken - Disturbed" => 2007, "Alive - Disturbed" => 2008, "Indestructible - Disturbed" => 2011, "Welcome to The Jungle - GNR" => 1970, "Animal - Disturbed" => 2012]; echo "<table>"; echo "<tr><th>Song/Artist</th><th>Year</th></tr>"; foreach($songs as $key => $value) { echo "<tr><td>$key</td><td>$value</td></tr>"; } echo "</table>"; ?> </body> </html> </pre>

-- Feb 22 In-Class Exercise
Name: Pei Liu
 <!DOCTYPE html>
 <html>
 <head>
 	<title>Favorite Songs</title>
 <style>
 table {
 	border: 3mm dashed;
 }
 </style>
 </head>
 <body>
 <?php
 $title = "Farvorite Songs";
 	echo "<h1>".$title."</h1>";
 	echo "
"; $ary = [["Song1","singer1","2001"], ["Song2","singer2","2002"], ["Song3","singer3","2003"], ["Song4","singer4","2004"], ["Song5","singer5","2005"], ]; echo "<table><th>Song Name</th><th>Singer</th><th>Release Year</th>"; foreach ($ary as $value) { echo "<tr><td>"; echo $value[0]; echo "</td>"; echo "<td>"; echo $value[1]; echo "</td>"; echo "<td>"; echo $value[2]; echo "</td>"; echo "</tr>"; } echo "</table>"; ?> </body> </html>
'''Name: Pei Liu''' <!DOCTYPE html> <html> <head> <title>Favorite Songs</title> <style> table { border: 3mm dashed; } </style> </head> <body> <?php $title = "Farvorite Songs"; echo "<h1>".$title."</h1>"; echo "<br/>"; $ary = [["Song1","singer1","2001"], ["Song2","singer2","2002"], ["Song3","singer3","2003"], ["Song4","singer4","2004"], ["Song5","singer5","2005"], ]; echo "<table><th>Song Name</th><th>Singer</th><th>Release Year</th>"; foreach ($ary as $value) { echo "<tr><td>"; echo $value[0]; echo "</td>"; echo "<td>"; echo $value[1]; echo "</td>"; echo "<td>"; echo $value[2]; echo "</td>"; echo "</tr>"; } echo "</table>"; ?> </body> </html>

-- Feb 22 In-Class Exercise
Richard Lack
<!DOCTYPE html>
  <head>
    <meta charset="utf-8">
    <title>Favorite Songs</title>
   
    <style type="text/css">
    table {border: 3mm dashed;}
    th, td {padding: 3px;
    }
  </style>
  </head> 
  <body>
   
   <?php 
         echo "<table>";
         echo '<h1>Favorite Songs</h1>';
         echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>";
         $a = array[["Thriller", "Mike", 2001], 
          ["Billy Gene", "Mike", 1998], 
          ["Born in th USA", "Bruce", 1995], 
          ["Cant Stop Believing", "Fun", 2004], 
          ["Forever", "Bon Jovi", 1996]];
         foreach ($a as $var) {
         echo "<tr><td>$var[0]</td><td>$var[1]</td><td>$var[2]</td></tr>";
         }
         echo "<table>";
   ?>
  </body>
</html>
(Edited: 2017-02-22)
Richard Lack <!DOCTYPE html> <head> <meta charset="utf-8"> <title>Favorite Songs</title> <style type="text/css"> table {border: 3mm dashed;} th, td {padding: 3px; } </style> </head> <body> <?php echo "<table>"; echo '<h1>Favorite Songs</h1>'; echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>"; $a = array[["Thriller", "Mike", 2001], ["Billy Gene", "Mike", 1998], ["Born in th USA", "Bruce", 1995], ["Cant Stop Believing", "Fun", 2004], ["Forever", "Bon Jovi", 1996]]; foreach ($a as $var) { echo "<tr><td>$var[0]</td><td>$var[1]</td><td>$var[2]</td></tr>"; } echo "<table>"; ?> </body> </html>

-- Feb 22 In-Class Exercise
Name: Loan Vo
<html>
 <head>
  <title>Favorites Songs</title>
 </head>
 <style> 
 table, td {
	border: 3mm dashed;
 }
 </style>
 <body>
 <?php echo '<h1> Favorite Songs </h1>'; ?> 
 <?php 
	$favorites = [["Yesterday Once More", "The Capenter", 1973], 				["Summer Kisses Winter Tears", "Elvis Presley", 1960],
			["Sealed With a Kiss", "Bobby Vinton", 1972], 
			["The End of The World", "Skeeter Davis", 1960],
			[ "The Day You Went Away", "M2M", 2000]]; 
 echo "<table> \n";
 echo "<tr><th></th><th>Song</th><th>Singer</th><th>Year</th></tr>\n";
 foreach($favorites as $key => $song){
			$rank = $key + 1;
	echo "<tr><th>$rank</th>";
	foreach($song as $var){
		echo "<td>$var</td>";
	};
	echo "</tr>\n";
}; echo "</table>\n"; ?>
 </body>
</html>
(Edited: 2017-02-22)
Name: Loan Vo <html> <head> <title>Favorites Songs</title> </head> <style> table, td { border: 3mm dashed; } </style> <body> <?php echo '<h1> Favorite Songs </h1>'; ?> <?php $favorites = [["Yesterday Once More", "The Capenter", 1973], ["Summer Kisses Winter Tears", "Elvis Presley", 1960], ["Sealed With a Kiss", "Bobby Vinton", 1972], ["The End of The World", "Skeeter Davis", 1960], [ "The Day You Went Away", "M2M", 2000]]; echo "<table> \n"; echo "<tr><th></th><th>Song</th><th>Singer</th><th>Year</th></tr>\n"; foreach($favorites as $key => $song){ $rank = $key + 1; echo "<tr><th>$rank</th>"; foreach($song as $var){ echo "<td>$var</td>"; }; echo "</tr>\n"; }; echo "</table>\n"; ?> </body> </html>

-- Feb 22 In-Class Exercise
Michael Nguyen	
<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="UTF-8"/>
    <title>Favorite Songs</title>
    <style>
	    table{
	    		border: 3mm dashed;
	    }
    </style>   </head>   <body>
		<?php
			echo "<h1>Favorite Songs</h1>";
			$favorites = [["All Stars", "Smash Mouth", "1999"], 
							["Never Gonna Give You Up", "Rick Astley", "1996"],
							["Beat it", "Michael Jackson", "1983"],
							["Stand By Me", "Ben King", "1961"],
							["Thriller", "Michael Jackson", "1982"]];
			echo "<table>\n";
			echo "<tr><th>Song</th><th>Singer</th></tr>\n";
			foreach($favorites as $song){
				echo "<tr><td>$song[0]</td><td>$song[1]</td><td>$song[2]</td></tr>\n";
			}
			echo "</table>\n";
		?>
  </body> </html> (Edited: 2017-02-22)
<pre> '''Michael Nguyen''' <!DOCTYPE html> <html lang="en-us"> <head> <meta charset="UTF-8"/> <title>Favorite Songs</title> <style> table{ border: 3mm dashed; } </style> </head> <body> <?php echo "<h1>Favorite Songs</h1>"; $favorites = [["All Stars", "Smash Mouth", "1999"], ["Never Gonna Give You Up", "Rick Astley", "1996"], ["Beat it", "Michael Jackson", "1983"], ["Stand By Me", "Ben King", "1961"], ["Thriller", "Michael Jackson", "1982"]]; echo "<table>\n"; echo "<tr><th>Song</th><th>Singer</th></tr>\n"; foreach($favorites as $song){ echo "<tr><td>$song[0]</td><td>$song[1]</td><td>$song[2]</td></tr>\n"; } echo "</table>\n"; ?> </body> </html> </pre>

-- Feb 22 In-Class Exercise
Xavier Reid
<!DOCTYPE html> <html>
  <head>
    <meta charset="UTF-8"/>
    <title>Favorites</title>
    <style>
      table {
        border: 3mm dashed black
      }
    </style>
  </head>
  <body>
    <?php
    echo "<h1>Favorite Songs</h1>";
      $songs = [
        ["Reverse Faults", "Sampha", "2017"],
        ["Self Control", "Frank Ocean", "2016"],
        ["The Season | Carry Me", "Anderson .Paak", "2015"],
        ["Saint Pablo", "Kanye West", "2015"],
        ["Turnin Me Up", "Bj the Chicago Kid", "2014"]
      ];
      echo "<table>";
      echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>";
      foreach ($songs as $val) {
          echo "<tr><td>$val[0]</td><td>$val[1]</td><td>$val[2]</td></tr>";
      }
     ?>
  </body>
</html>
(Edited: 2017-02-22)
Xavier Reid <!DOCTYPE html> <html> <head> <meta charset="UTF-8"/> <title>Favorites</title> <style> table { border: 3mm dashed black } </style> </head> <body> <?php echo "<h1>Favorite Songs</h1>"; $songs = [ ["Reverse Faults", "Sampha", "2017"], ["Self Control", "Frank Ocean", "2016"], ["The Season | Carry Me", "Anderson .Paak", "2015"], ["Saint Pablo", "Kanye West", "2015"], ["Turnin Me Up", "Bj the Chicago Kid", "2014"] ]; echo "<table>"; echo "<tr><th>Song</th><th>Artist</th><th>Year</th></tr>"; foreach ($songs as $val) { echo "<tr><td>$val[0]</td><td>$val[1]</td><td>$val[2]</td></tr>"; } ?> </body> </html>
[ Next ]
X