|
<?xml version = "1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Fig. 8.7: average.html --> <!-- Class Average Program -->
<html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Class Average Program</title>
<script type = "text/javascript"> <!-- var a=1, b=7, c=9; document.writeln("Skip this" + a + "<br>"); while ( a < c ) { document.writeln("Junk" + a + "<br>"); a=a+1; { while ( b > 2) { document.writeln("Loop" + b + "<br>"); if ( b > 4) { document.writeln("go" + b + "<br>"); } b=b-2; } } if (a == 5) { document.writeln("Skip" + a + "<br>"); c=c-2; } document.writeln("Again" + a + "<br>"); a = a + 2 }
// --> </script>
</head> <body> <p>Click Refresh (or Reload) to run the script again</p> </body> </html>
|