Christopher Wiley September 1, 2006 Overview: The purpose of this program is to track the population of a lethal bacteria that originated in anti-bacterial salad dressing. The program assumes the bacteria divide simultaneously every thirty seconds and that there was originally only one bacteria present. My goals in this assignment were to provide the users of this program, presumably scientists, with both a rough decimal approximation of the population of bacteria after a given number of hours, and an exact count of the bacteria theoretically present. Description of Solution: My solution relied heavily on JAVA libraries instead of original code of my own. I first retrieved the number of hours from the command-line arguments, and after making sure the number was a postive decimal, calculated the number of divisions mathematically. To approximate the number of bacteria I used a function that calculates the powers of numbers which I found in the standard Math library. To calculate the exact number of bacteria I used the BigInteger class and its provided function to handle powers. All errors were printed to standard error and all output to standard out. I tried all the provided test cases, a "0" case, and a no argument case. Surprises: Initially I tried to cast the decimal to a long, which caused an incredible lack of precision, even to the point where it could be termed "flat out wrong." I should have guessed that anything that large would have to be recorded in an expandable integer wrapper class. Algorithm: My code runs in 0(1) time, top to bottom; I have no loops and no recursion. Unfortunately, because I am not a Sun Architect and have no desire to look through whatever source they may have released I cannot speak for the library functions they wrote. My experience in the past has been that JAVA library functions are both more reliable and faster than hand written code, because they have the vast advantage of study and experience behind them. The overhead for writing in JAVA is instead the overhead of running the virtual machine. Comparison: The same situation could be modelled using loops that decrement the total number of seconds by thirty and double the bacteria count each iteration. Such a situation more closely resembles the real life situation, but runs in O(n). Such a solution if properly implemented would behave no differently than my implementation other than running far slower. Different Environments: I tend to use Eclipse because it has excellent features for auto-importing classes and reduces the need to remember all those package names, as well as maintaining code indentation conventions and other nice little tools. It also auto-completes method signatures. Using notepad and a command-line makes debugging a little more simple, as Eclipse puts an additional layer between the programmer and the java/javac commands. However, notepad is like trying to rememeber the first name of my 7th grade English teacher who I really didn't like anyway when suddenly I have to pull the names of all kinds of packages and method signatures out of a hat. There apparently is a crowd which despises using modern software to make coding easier, but include me out.