Tuesday, November 27, 2012

References and Parameters

(This is the post after Thanksgiving break) This is a topic we just learned about today, and although I still might not get it entirely, my comprehension of it is much better than the previous weeks' topics. I think writing the examples on the board and explaining it in a more visual way is better for me because it becomes more logical when I can see it. I would say that maybe when the slides are being presented, it might help a little to present more examples. The ones that I saw were good, but I felt that they went a little fast. Other people might get the concepts more easily than me because it takes me more time to make the concepts "click." Not really sure how I can understand these better when they're taught, but for now I'll probably just refer back to the powerpoints when I do labs and worksheets. For now, I'll do the worksheets first before I even look at the lab because it might make more sense to understand what I'm actually doing. I still have to finish worksheets from before the break on nested for loops as well as the lab I'm doing with my group.

Monday, November 12, 2012

More Arrays

The six weeks just ended, which is both a good and bad thing. It's good to start a new week with only one week before Thanksgiving break, but also bad because of the amount of tests we've had to manage. My test grade was bad, but I don't think it really represents how hard I've studied and how quickly I grasp the material. The questions were very different from what we had practiced on the quizzes and the labs, so it was good that I was able to do test corrections. One thing that I learned while doing my test corrections was the concept of having something like... for (int x: arr) in the code. Apparently, this format makes the code do the same thing to every int in the array sequence individually. For instance, if I had {1, 2, 3, 5, 7}, the code following this dictation would implement the same function on each value in the array. I didn't know this prior to taking the test, which is why I might have missed some of the questions pertaining to this concept. Similarly, I couldn't really distinguish the difference between something like arr[i] and i itself. I probably could have noticed my mistakes pertaining to this had I more time on the exam, but unfortunately I didn't have that luxury. Most of my mistakes were careless/me forgetting prior concepts such as substring. Substring starts from a certain index and ends on another index EXCLUDING that value. This is something that clearly slipped my mind while I was taking the exam and I missed a question for that. I don't know exactly what the difference was between the last test and this test because I did fine on the last one. It's possible that the material on this test was more difficult and complex, but I also think that there were just too many holes in my comprehension of it when I was going into the test. For the next one, I suppose one of the only things I can do is go more in-depth on what we're studying and hopefully I'll come out on top this time.

Wednesday, November 7, 2012

Arrays

This past week, we learned about arrays. The concepts were new, but not too daunting. The week went by a little better than the previous ones because I was able to fix the GCD lab for my group. Apparently, || and && can make all the difference in the world when completing a code!
This is a segment of our code from the lab:


public int findGCD()
   {
      int gcd = numerator;
     
         if(numerator > denominator)
         {
            gcd = denominator;
           
            while(numerator%gcd != 0 || denominator%gcd != 0)
            {
               gcd--;
            }

         }

Before, the || sign was an &&, and we simply could not figure out why jGRASP kept returning 0/1 or 1/1 for the GCD when we input fractions that needed to be simplified. 0 and 1 are two of the most common GCD's when simplifying, and it makes sense in a context like this. For instance, if the fraction we entered was 16/8, the program could only increment downward if BOTH of the numbers' remainders were not 0. 
Overall, as I'm preparing for the test, I find that it's better to review all of the worksheets and quizzes in order to remember all of the information. The labs are also going to be a good source of studying because they contain a lot of the curriculum that we are learning in class. Hopefully, I can apply the information in the lab to the test.