Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College




This page contains many example C++, Java, PHP, SQL, and Alice code. There is also a section called Assignments which contains code that I use in some assignments. You can probably safely ignore that section unless you are specifically directed there in an assignment.

For some programs, there is a description file available.

The point of these examples are to assist you in learning how to do various things in these languages, ranging from implementing constructors, destructors, overloading operators, and working with pointer in C++, to basic syntax, recursion, classes, how to write applets, programming with swing, and event handling in JAVA.

  • For each C++ program, all of the .h and .cc files, as well as makefiles, are viewable. In some cases a zip, or tar/gzip files containing all of the files is available for download.

    Note: These programs were written before the new C++ standard came into effect. You might have to make slight modifications to compile them without warnings. Some of these have been updated, but I have not gotten around to fixing them all.

  • For JAVA programs, all of the relevant .java files are viewable. In some cases, the JAVA programs are runnable in the webpage, and the jar file is available for download.
Note: To download any of the code, download the zip or jarfile if it is available. If you cut and paste from the page, you might find that the code is messed up. This is because the < and > symbols were replaced with the code &lt; and &gt; to make it display in the page properly (Since < and > are HTML symbols). It appears that cutting and pasting usually works, but it may depend on your browser and/or what application you paste into.