Value Tracing Samples

Value Tracing Samples - for( var i = 0 i < 4 i++...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 <html> <head></head> <body> <script type='text/javascript'> /* var a = 2 var b = 5 var c = b a = b*a if( a > c ) { a-- } c = a+b document.write( a + "<br />" ) // document.write( b + "<br />" ) // document.write( c + "<br />" ) // var i = 0 var j = 10 var k = 5 if( i = j ) { k+= 1 } else { k -= 1 } j = i + j document.write( "i = _______________ " + i + "<br />" ) // document.write( "j = _______________ " + j + "<br />" ) // document.write( "k = _______________ " + k + "<br />" ) // var m = 2 var n = 2 var o = "happy" if( m < n ) { o = "sad" m++ } else if( m >= n )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 { o = "ecstatic" n++ } else if( m == n ) { o = "suspicious" m = m+m } else { o = "dissatisfied" n = n-m } document.write( "m = _______________ " + m + "<br />" ) document.write( "n = _______________ " + n + "<br />" ) document.write( "o = _______________ " + o + "<br />" ) var x,y,z var myBool = false
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for( var i = 0 i &lt; 4 i++ ) { x = i y = x*2 z = y/2 } if( z &gt; x ) { myBool = true } document.write( &quot;x = _______________ &quot; + x + &quot;&lt;br /&gt;&quot; ) document.write( &quot;y = _______________ &quot; + y + &quot;&lt;br /&gt;&quot; ) document.write( &quot;z = _______________ &quot; + z + &quot;&lt;br /&gt;&quot; ) document.write( &quot;myBool = _______________ &quot; + myBool + &quot;&lt;br /&gt;&quot; ) var p = 10 var q = 0 while( q &lt; 5 ) { p -=2 q++ } document.write( &quot;p = _______________ &quot; + p + &quot;&lt;br /&gt;&quot; ) document.write( &quot;q = _______________ &quot; + q + &quot;&lt;br /&gt;&quot; ) var f = 1 var g = 0 Sheet1 Page 3 do { f += 20 g -= 20 } while( g &gt; f ) document.write( &quot;f = _______________ &quot; + f + &quot;&lt;br /&gt;&quot; ) document.write( &quot;g = _______________ &quot; + g + &quot;&lt;br /&gt;&quot; ) */ &lt;/script&gt; &lt;h3&gt;Download this file or view it's source to see the hidden javascript code.&lt;/h3&gt; &lt;/body&gt; &lt;/html&gt;...
View Full Document

This note was uploaded on 02/08/2011 for the course COMP APPS 198 taught by Professor Stout during the Spring '10 term at Rutgers.

Page1 / 3

Value Tracing Samples - for( var i = 0 i &amp;amp;lt; 4 i++...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online