public class FizzBuzz {
/**
* @param args
*/
public static void main(String[] args) {
for (int i = 1; i < 101; i++) {
if (((i%3)==0) && ((i%5)==0)) {
System.out.println("FizzBuzz");
}
else if ((i%3)==0) {
System.out.println("Fizz");
}
else if ((i%5)==0) {
System.out.println("Buzz");
}
else {
System.out.println(i);
}
}
}
}
The total time it took to create this program in Eclipse was 5 minutes 20 seconds. Much of the time was spent using the Eclipse tutorial to figure out how to run a java application in Eclipse. After using the tutorial to write the infamous Hello World program, writing the FizzBuzz program was relatively easy. Other than figuring out how to use Eclipse, I did not encounter any other problems with Eclipse or java.
In general, this assignment has shown me how difficult it can be to implement even relatively simple programs that are syntactically and stylistically correct without a computer. The moral of the story is that while technology may be a great asset, we shouldn't rely on it to the point that we cannot function without it. In a world, where many of us use the compiler as a crutch, it is actually hard work, dedication, and practice--and being able to implement simple programs by hand--that separates a decent programmer from a great one.
No comments:
Post a Comment