initial translations of examples 1-4 to Java, using Netbeans Project
translated example 3 to C