Difference between revisions of "CSC103 Homework 4 Solutions"
(Created page with "--~~~~ ---- <code><pre> Homework #4 Kristina Fedorenko Program #1 <html> <body> <script language="JavaScript" type="text/javascript"><!-- document.write(<h1><b>CSC103 Homew...") |
|||
Line 1: | Line 1: | ||
--[[User:Thiebaut|D. Thiebaut]] 10:02, 22 April 2011 (EDT) | --[[User:Thiebaut|D. Thiebaut]] 10:02, 22 April 2011 (EDT) | ||
---- | ---- | ||
− | + | ==Solutions for Homework #4== | |
+ | ;Homework #4 | ||
+ | ;Kristina Fedorenko | ||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ===Program #1=== | ||
+ | <code><pre> | ||
<html> | <html> | ||
<body> | <body> | ||
Line 27: | Line 26: | ||
</script> | </script> | ||
</body></html> | </body></html> | ||
+ | </pre></code> | ||
− | Program #2 | + | ==Program #2== |
+ | <code><pre> | ||
<html> | <html> | ||
<body> | <body> | ||
Line 50: | Line 51: | ||
</body></html> | </body></html> | ||
+ | </pre></code> | ||
− | Program #3 | + | ==Program #3== |
+ | <code><pre> | ||
<html> | <html> | ||
<body> | <body> | ||
Line 78: | Line 81: | ||
</body></html> | </body></html> | ||
+ | </pre></code> | ||
+ | |||
+ | <br /> | ||
+ | <br /> | ||
− | + | <br /> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </ | + | <br /> |
+ | |||
+ | <br /> | ||
+ | [[Category:CSC103]][[Category:Homework]] |
Latest revision as of 09:04, 22 April 2011
--D. Thiebaut 10:02, 22 April 2011 (EDT)
Solutions for Homework #4
- Homework #4
- Kristina Fedorenko
Program #1
<html>
<body>
<script language="JavaScript" type="text/javascript"><!--
document.write(<h1><b>CSC103 Homework #4</b></h1>)
document.write(<h3><b>Kristina Fedorenko</b></h3>)
document.write(<h3><b>CSC 103</b></h3>)
document.write(<h4><b>Table of multiplication of 5</b></h4>)
var i;
for ( i = 1; i <= 10; i++ ) {
document.write(5 + " x " + i + " = " + 5*i +"<br>")
}
//-->
</script>
</body></html>
Program #2
<html>
<body>
<script language="JavaScript" type="text/javascript"><!--
document.write(<h1><b>CSC103 Homework #4</b></h1>);
document.write(<h3><b>Kristina Fedorenko</b></h3>);
document.write(<h3><b>CSC 103</b></h3>);
document.write(<h4><b>Table of multiplication of 5 (with bullets)</b></h4>);
document.write("<ul>");
var i;
for ( i = 1; i <= 10; i++ ) {
document.write("<li>"+5 + " x " + i + " = " + 5*i);
}
document.write("</ul>");
//-->
</script>
</body></html>
Program #3
<html>
<body>
<script language="JavaScript" type="text/javascript"><!--
document.write(<h1><b>CSC103 Homework #4</b></h1>);
document.write(<h3><b>Kristina Fedorenko</b></h3>);
<!-- outer loop, creates a multiplication table for numbers 2 - 9 -->
var j;
for (j=2; j<=9; j++){
document.write("<b>Table of multiplication of " + j + "</b>" );
document.write("<ul>");
<!-- inside loop, creates a single entry of the multiplication table -->
var i;
for ( i = 1; i <= 10; i++ ) {
document.write("<li>"+ j + " x " + i + " = " + j*i);
}
document.write("</ul>");
}
//-->
</script>
</body></html>