Assignment 11 - Multiplication Table

You can download this homework and set the permissions with the commands
      cd ~/public_html
      wget http://www.comp.nus.edu.sg/~gem1501/assignment11.html
      chmod 755 *.html 
  1. General Outline
    Children learn the multiplication table for the system based on 10 at school. Such a table can of course be produced in the system based on any number being at least 2. Here an example for the multiplication table of the system based on 13. Note that the letters A,B,C are used for the missing digits. The task is to write a program that computes the multiplication table for any given base between 2 and 36. This homework contains a predefined program to compute the multiplication table for the base 10 and the task is to implement the same program for other bases then the usual one. Note that the letters "A,B,C,..." are used for expressing digits beyond "0,1,2,...,9" whenever the base requires more digits than the usual ten. For more information on number systems and bases, please see the corresponding Wikipedia page.

  2. Make multiplication table of variable size
    Introduce a variable "base" for the multiplication which is obtained from the user by the command
          base = prompt("Enter Base of Numbering System"); 
    Change the loop boundaries and other places which refer to the decimal system adequately. Furthermore, take care that the sides of the multiplication table are also output in the system for the chosen base. Also, replace the 10 in the loop to compute the digit in the fields "ones" and "tens" by the value of base and make the two arrays to be two-dimensional arrays of size "base times base".

  3. Addition Table
    Add an addition table to be calculated and printed after the multiplication table for the same base.
Java Script Program starts here.

Java Script Program ends here.