Wednesday, September 3, 2008

New Beginning

Welcome to my blog.
I hope you will enjoy this journey with me as I develop my software engineering skills. This blog will mainly focus on the projects and experiences I have in ICS 413. I am excited in expanding my portfolio and learning new things to expand my set of software engineering tools.

The first assignment for the class is to program a simple Java function called FizzBuzz. This function will count from 1 to 100. If the number is a multiple of three, I should print out "Fizz". If the number is a multiple of five, I should print out "Buzz". If the number is a multiple of both three and five, I should print out "FizzBuzz". And finally, if the number does not fit any of the above it will just print the number.

The purpose of the assignment is to brush up on our Java skills because our use of Java are very limited after ICS 211. By refocusing on Java, we can build upon our foundation and to experience software engineering in a larger scale.

After installing Eclipse, I went through the short tutorial and started programming FizzBuzz. I mainly used Notepad++ when coding and I can see the big difference immediately. It was very nice for Eclipse to set up all the classes for me and to watch all my brackets. The only problem I have so far was to locate the compile/run button. Everything was straight forward and I'm looking forward to finding more tools in Eclipse to use.


public class FizzBuzz {

/**
* @param args
*/
public static void FizzBuzzFunction (int n){
for(int i = 0; i <= n; 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);
}
}
}
}
}

public static void main(String[] args) {
// TODO Auto-generated method stub
FizzBuzzFunction(100);
}
}

No comments: