Difference between revisions of "CSC231 Homework 5 2015"

From dftwiki3
Jump to: navigation, search
(Created page with "--~~~~ ---- <center> <font size="+2">Page under construction!</font> </center> <P> <center> 300px </center> =Problem #1= <br /> This will...")
 
(Problem #1)
Line 10: Line 10:
 
=Problem #1=
 
=Problem #1=
 
<br />
 
<br />
This will have to do with the speed of a javascript program.
+
* Ssh  to aurora.smith.edu using your 231a-xx account.
 +
* Go into your account's public_html directory.
 +
* Create a file with emacs, and call it '''javascriptTest.html".
 +
* Store the following code into it:
 
<br />
 
<br />
 +
::<source lang="html">
 +
<html>
 +
  <body>
 +
 
 +
      <script type="text/javascript">
 +
        <!--
 +
            var a = 33;
 +
            var b = 10;
 +
            var c = "Test";
 +
            var i = 0;
 +
            var linebreak = "<br />";
 +
 +
            document.write("sum_i=0^100 = ");
 +
            sum = 0;
 +
            for ( i=0; i<=100; i++ ) {
 +
                sum = sum + i;
 +
            }
 +
            document.write( sum );
 +
            document.write(linebreak);
 +
        //-->
 +
      </script>
 +
     
 +
      Example of Javascript arithmetic.
 +
      <br />
 +
 +
  </body>
 +
</html>
 +
</source>
 +
 +
<br />
 +
 
=Problem #2=
 
=Problem #2=
 
<br />
 
<br />
 
Speed of a Java program using BigIntegers instead of ints.
 
Speed of a Java program using BigIntegers instead of ints.
 
<br />
 
<br />

Revision as of 14:15, 28 October 2015

--D. Thiebaut (talk) 15:31, 21 October 2015 (EDT)


Page under construction!

UnderConstruction.jpg

Problem #1


  • Ssh to aurora.smith.edu using your 231a-xx account.
  • Go into your account's public_html directory.
  • Create a file with emacs, and call it javascriptTest.html".
  • Store the following code into it:


<html>
   <body>
   
      <script type="text/javascript">
         <!--
            var a = 33;
            var b = 10;
            var c = "Test";
            var i = 0;
            var linebreak = "<br />";

            document.write("sum_i=0^100 = ");
            sum = 0;
            for ( i=0; i<=100; i++ ) {
                sum = sum + i;
            }
            document.write( sum );
            document.write(linebreak);
         //-->
      </script>
      
      Example of Javascript arithmetic.
      <br />

   </body>
</html>


Problem #2


Speed of a Java program using BigIntegers instead of ints.