GrassLikeStalk Programming My collection of source codes.

>>  Home  >> MyCode

Updated Thu 18Jan18 1606hr

Under Construction . . .

This is a loose collection of various C and Java programs, including ADTs and data structure applications which I have developed over my years of teaching in this college. Each of the following links opens in a new window.

Java Applets

Announcement 01Jan2018: It has been nine long years since I last edited the contents of this section on Thur 13Nov2008 2053hr. Over the years, browsers like Chrome and Opera have stopped supporting NPAPI for Java Applets, causing many of the sample applets below to fail to run on this page.

As such, I have decided to embark on a journey to rewrite and implement the functionality of some of these applets using JavaScript. Over the coming weeks, the Java Applets below will be gradually replaced by their equivalents in JavaScript.


  1. innerHTMLdemo Demonstrates how JavaScript can change the contents of html. **Updated Sat 06Jan2018 1415hr**
  2. Show Date & Time Uses JavaScript Date( ) function to display the system date and time in an element. **Updated Sat 06Jan2018 1403hr**
  3. Change Image Source JavaScript Replaces the source of an image in an img placeholder. **New Thu 18Jan2018 1610hr**
  4. Very Simple Calculator A primitive calculator which I built from the ground up, without reference to any existing code, literally re-inventing the wheel. It was done as a final week to my Intro to Java class to show them what their 14-week course can do!
  5. DisplayImage with URL Displays a still image of a flag. It demonstrates the use of a swing ImageIcon with a URL reference.
  6. Paint Icons of Flowers Displays icons of various flowers in response to command buttons. Again, this is a demo of an ImageIcon with its paintIcon method in action.
  7. ZoomInOut Employs the Graphics drawImage method, using an Image object instead of ImageIcons. An overloaded method of drawImage accepts applet width and height parameters. This is put to good use in this ZoomIn-ZoomOut applet.
  8. Loan Calculator Applet Helps you get an idea of monthly repayments to a typical loan calculated on monthly rests. Caution: its results may differ from those of commercial banks! The deprecated <applet> tag on this html page has been replaced by the <object> xhtml compliant tag, customised to work with both Mozilla and IE browsers
  9. Investment Calculator Quite the reverse of the above loan calculator, this applet lets you enter how much you'd like to set aside as savings each month and it calculates your total accumulated savings on monthly compounded interest.
  10. Investment-cum-Loan Calculator I've merely made both applets available on one page. Nothing new . . .

HTML, JavaScript, XMLDOM

Announcement 01Jan2018: Like the Java Applets section above, I last edited the contents of this section nine years ago on Thur 13Nov2008 2053hr. Since then, advances in XML definitions have caused some of the following samples to fail in the browser. Over the coming weeks, I will be updating them to make them compliant with current definitions.


  1. CafeMenuBill
  2. A CD Catalog Using XML
  3. A CD Catalog Using XML - older version
  4. View the entire CD Catalog - uses XmlHttpRequest *New**13Nov08*