These are JavaScript programs I wrote for computer science course in Grade 11.

They are posted here for your enjoyment. I would appreciate if you wouldn't simply take the code; rather, acknowledge the original author (me) with a brief comment in your code like:

Parts of code written by Derek Tsang

Web developers may use these programs, or parts thereof, in their own programs, so long as I am acknowledged.

The code presented here is commented and should obey standard programming conventions. The code also should work directly in your web browser, unless otherwise noted. These programs are presented here for educational purposes, and I do not actively maintain them.

Alphabet Check - counts the number of vowels in a passage
Dice - Rolls to see how many times it takes to get the same number back
Loop - Prints ascending numbers
Mortgage - calculates mortage principal
Binary converter
Conversion from inches to centimetres
Marks Average - calculates the average from a set of grades, or marks
Output Value - dynamically prints mathematical manipulations of numbers
Reading of Words - real-time word count; counts words, as you type them
Word count - count how many times a specific word occurs in a passage.

For a practical example of JavaScript in action, take a look at my Download Time Calculator, which I actively maintain.

Return to home.