UNC-CH COMP 110

Examples Developed in Class


Many of these may execute more easily in Firefox. Default popup blocker settings in IE may prevent your from entering input on some.

Click a link to see the web page and run the program. When viewing the web page for a program, you can view the code itself with "view source".


Java examples

One source file, one class definition
        One function (main)
        Two functions (main and cuber)
        done in class 11/01/10

JavaScript examples

Basic Function Usage
        Javascript code for it
        done in review 10/26/10
Basic Sorting: Bubble Sort
        Timing version of the sort
        done in class 10/20/10
Using coordinated arrays
        done in class 10/18/10
Bones of Assignment 5
        done in class 10/13/10
generating random data (in an array)
        done in class 10/11/10
first look at arrays
        done in class 10/6/10
simple function to square a number, with isNaN checking
        bones of Assignment 4
        done in lab 10/1/10
passing HTML text fields into a program
        done in class 9/29/10
simple helper functions
        functions with parameter passing, return value
        done in class 9/27/10
circle computations: sequential if-then conditionals
        circle computations: if-then-elseif-else conditional
        circle computations: switch conditional
        done in class 9/22/10
while loop controlled by user text input(several stop choices)
        infinite while loop and "break" to end it
        done in class 9/20/10
program to compute a grade average
        while loop controlled by user text input
        done in class 9/15/10
program showing conditional behavior (if-then-else)
        program showing definite repetition (for loop)
        done in class 9/13/10
First very simple program
        Assignment 2 base program
        done in class 9/08/10

HTML examples

HTML page with picture
        HTML page with a table
        done in class 9/01/10
simple HTML page
        page2 HTML file
        done in class 8/30/10