Assignment 0 - Finding Syntax Errors

You hand in this assignment by showing it to the lecturer when it is completed. This assignment contains some syntax errors you should correct and it works well when you can run it without an error message been displayed and the 10 randomly chosen numbers analyzed correctly.

  1. Getting Started

    Please refer to this page for information on how to work on your assignment.

  2. Make yourself familiar with the program

    Most of a web page is written in Hypertext Markup Language (HTML). But this page contains also some parts in JavaScript. Note that there is an other programming language with the name Java, but JavaScript shares with it just the name. These parts are mixed into the HTML page. In order to make it easier for you to learn to program with JavaScript, you receive almost ready programs. So you do not need to learn HTML.

    Follow the link for an introduction to JavaScript.

  3. Task of this exercise

    This exercise is quite easy. Its main task is to teach you to find typing errors in a program, this process is called debugging. The given program has errors in seven lines and you should find and correct them all; some of the faulty statements are superfluous and can be deleted, others have to be corrected.

    Your web browser provides help for finding JavaScript bugs. You have two browsers available in the lab: Mozilla Firefox 17 and Internet Explorer 7. We recommend you to choose Firefox, as it strongly adheres to web standards and its version is quite up-to-date, unlike Internet Explorer. However instructions are given for both.

  4. What the correct program does

    The corrected program computes the divisors of 10 randomly chosen numbers between 1 and 99 and then checks whether the chosen number is prime, square or having only one decimal digit. The number and the diagnosis about it are printed out.

JavaScript Starts Here.
JavaScript Ends Here.