Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Final Exam Review Fall 2003: JavaScript

Questions, comments, answers?

Back to Fall2003 Final Exam Review




<html> <head> <title> The Simplest Possible Web REMOVED
</title> <script> function countDowntoOne() {
    document.write("<ul>");
    for(i=100; i<=1; 1--)
    {
       document.write("<li>Item number:", i);
    }
    document.write("</ul>");
} </script> </head> <h1>A Simple Heading</h1>
<p>this is a very simple web page.</p> <p><<image
src="mediasources/barbara.jpg"/> </p> <script>
countDowntoOne() </script> </body> </html>




Everything is the same except for the line:

for(i=100;i<=1;i–)

I'm pretty sure it should be i>=1 because with i =1, the function would stop right away. 99 is not less than 1, so it would stop.

for (i = 100; i >= 1; i--){...}


What exactly is Java good for as opposed to Python? What's the difference b/t the two as far as what you use them for? Just wanted to know!

Great question! Java is good for serious program development, building programs with thousands or even millions of lines of code. It has features like being able to "protect" variables and methods so that some are private and not directly accessible by other programmers – that way, when programmers share each others' code, programmers don't accidentally break another piece of the program (e.g., object) by modifying critical (private) variables in ways that they're not supposed to be modified.

Python is designed for smaller programs with smaller development teams (most often just a single programmer, but maybe a handful of programmers). It's made to be easy to use. Java is harder to use, but the rigor makes it REMOVED likely that larger programs can be assembled from smaller parts and work.

Does that help? Mark Guzdial


Note, though, that the program on this page is JavaScript, not Java. JavaScript looks a lot like Java, but Java has REMOVED features and can't be embedded in web pages in the same way as JavaScript. Mark Guzdial

Although it probably makes me sound like a nerd, this problem makes me miss C++


only a little like a nerd. kiddin'


Here are some last minute JavaScript questions from the lecture. Can someone pls. ans. bf. clock ticks 8am.

5. How is JavaScript used on web servers?
It's possible to use JavaScript to control creation of web pages, including access to databases. That's how it's often used on webservers. Mark Guzdial
6. On slide 39 of JavaScript, what is the 100 in drift and what is <div id="barb"> doing?
Every 100 ms, the JavaScript function drift is executed, which finds the division "barb" and changes its position by 5 pixels in both the X and Y directions. That's what causes the picture to "drift." Try it! Mark Guzdial


Why
(i=100; i>=1;i–) and not i++ 

instead?/





Link to this Page