Excessive

Writing Photography Rambling

January 28, 2011 1:39PM

Java Destroyed


Today I had an in-class assignment in Java and while I did arrive late, the assignment didn't start until an hour into the class, so it was all good. We had a choice of two different problems, one was selecting random numbers between 1-99 and storing them in a data structure that wasn't array, ensuring there were no duplicate numbers and then printing the numbers to the screen. The second option was simply writing a function that will calculate the factorial of a number without use of recursion, and that seemed really easy to me, so I went with that.

It literally took me 2 minutes to write it, it was a one line for loop:

public static double calculateFactorial(int number){
   double factorial = 1;
   for(int i=number; i!=0; i--)
      factorial *= i;
   return factorial;
}

I was the first one done, and I got a drive home with Calen afterward.

I just went to the grocery store for the first time in what seems like months, and I got a few things I needed for comfort - soup, fries, chips, etc - and now I'm home and I'm going to have a really well made chicken caesar salad for lunch. I bought a block of real parmesan cheese I will grate into it, bacon, chicken breast, splash of lemon juice and nice romaine lettuce. It should be a really satisfying and filling lunch.

For the rest of the afternoon I'm going to be relaxing... playing WoW, maybe watching TV... should be a good day.

Tomorrow I've got work at 10 till whenever, and I don't have my schedule for Sunday or the next week. Not particularly looking forward to work but whatever.


289 words

No Tags
Timeline
  • I lived on Langarth St.
  • I worked at Windermere
  • Michelle was my Roommate

Leave a Comment

Your email address will not be published. Required fields are marked *