Sunday, December 9, 2012

Almost Finals

Now that I have all (or most) of my worksheets in, I feel a little bit more relaxed than last week. Unfortunately, I still feel a bit suffocated from all of the finals that are going on. This stress happens every semester during finals, but especially this year because the Dec. 31/Jan. 1 college application deadline is approaching pretty quickly. I'm hoping that I can prepare well for my comp sci final enough so that I spend a sufficient amount of time on it, but not an overwhelming amount of time on it. I think time management should be key here, but we'll see how the rest of the month pans out. The whole senior/college experience thing is also really harsh mentally, because there's always a fear of messing up something. Oftentimes I keep having to mentally motivate myself to keep going and to keep getting things done, and it's becoming extremely stressful. When Tuesday/new material comes, I want to be in a good enough shape so that I can receive this new information/prepare for finals/not have my brain explode with stress. Finals/college apps/senior year is almost like a marathon. Whoever keeps going in the end will win the race, so I have to just keep going and keep getting things done. Not to be too descriptive or anything.

Also Mr. Stephens, I might ask you sometime this week or next to send your teacher recommendation letter to another college (potentially University of Rochester)? This might depend on what I decide within the next week, but if I decide to apply, I'll give you the envelope/stamp and everything (just a heads-up). Thanks-

Sunday, December 2, 2012

References and Parameters

The worksheets on references and parameters are more challenging than I initially thought they would be. Nested loops weren't too bad, and going off of those worksheets, I can definitely say that references and parameters are much more confusing. That quiz was definitely not very easy at all, and I'm going to have to retake that and study it a lot. It's just getting more confusing because the code is so long, one thing points to another, and you have to keep track of things otherwise you'll get really confused. Diagraming used to help me a lot when I tried to work things out in my head, but now that I'm at this point, even the diagrams are confusing. Worksheets are also piling up, which isn't fun, and I'm trying to stay on top of things even though we get new worksheets/labs almost every day. Hopefully we'll have a work day soon so I can catch up on everything. It's kinda hard to keep up when you have the previous week's work plus new material to deal with. In addition to that, bringing those worksheets home and trying to finish them plus college apps and other homework is much harder. I'll see if I can come to tutoring if I have time during lunch or before school, but in the meantime, we'll see how the workload evens out. December 1st just passed, so most of my college apps are in, and I'll get to take a tiny break before I start on my January 1st apps. Being a senior is fun.

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.

Tuesday, October 30, 2012

Files

Last week, we started learning about Files. Unfortunately, my group and I are still on Deal, which puts us behind a little bit. At first, I thought that working in a group was a good idea, but I'm starting to see some negative effects of it in that it's taking much longer as a group to finish the program. I think this is true because previously, if I didn't finish a lab in class or didn't quite understand it the first time, I could bring the lab home and work on jGRASP on my computer. That was really convenient for me because I can't always focus on my work with the distractions in class. Now that I'm working in a group, I have to coordinate with my group members on 1) When to come in during lunch or 2) When we can come in and work on it. I think we should be given the choice on whether we want to work individually or not because I think it was more successful for me. This may not be true for everyone else, of course, but I think I might be better off learning on my own. When someone else is typing, I think it's easy to stop focusing on the program as opposed to directing our full concentration on it. For example, I might be paying attention only 75% to what is going on as opposed to 100%. I was also sick yesterday and didn't come to school, so I couldn't come during lunch to work on the program with my group, and that could cause some problems. I'll try to study the material on my own and see what comes of it because I need to get back into my old habit of doing everything by myself. It's probably not a good idea to rely on other people because there could be gaps in my understanding of the material.

Tuesday, October 23, 2012

While

During the past week, we had to integrate "while" into our labs. We worked in pairs to complete the lab and switched every so often. I thought that this method was significantly more helpful than the individual lab, mostly because I wasn't lost the entire time. It's helpful to know just where to start, and unfortunately, I usually don't know where to start when I work alone. As pairs, we can help each other when we have gaps in understanding. In addition, it's better for me when I can observe someone else's code as opposed to my own, because I am always a little bit self-conscious about whether or not I'm correct. When you're helping another student on the other side of the classroom, we may have to wait a while before you come around to our side of the classroom, and unfortunately, we're not always so patient. It goes without saying, but it's nice to be able to get immediate help from other people who may actually understand the subject material a little better. The "GCD" lab wouldn't compile for a while, and I think that something may have gone wrong during the calculations portion of our lab. This presents a problem with working in pairs, because I won't always "think for myself" because 1) I might think the other person is right and 2) I might not be as cautious as I normally am because someone else is doing the work. That being said, there's a positive and negative side to this method, but I think it was positive for the majority of the lab "experiment." Overall, I think that this working method is a success.

Sunday, October 14, 2012

Boolean 2

This week, we learned more about Boolean. We had a lab involving CodingBat, which was straightforward for the most part. The hardest part of using Boolean was using nested "if" statements because I didn't exactly know how to write them myself. I realized that I can really only write code myself if I see a correct example of it the first time. Otherwise, I'm mostly going blind writing the code. The trickiest part when writing nested "if" statements is your ability to read it. Java doesn't mind it if you don't indent anything or if you don't organize your statements. However, indenting different lines actually really helps you understand the problem as as whole. This is what I discovered when I did the MakeChocolate problem in the lab. I couldn't visualize everything at once, and it was difficult doing the trial-and-error method where I wrote something and compiled it just to see if it would work. Instead, I had to take it one step at a time and start from scratch. I wrote one if statement (with or without nested ifs) and looked to see if there was perhaps another possibility that I was missing. Then I would write the next statement. I realized that if I organize my statements in this fashion, it will be much easier logically to write the entire code correctly as opposed to trial-and-error. That was probably the hardest part about writing these codes. A lot of the problems in the lab involved math that was a little more complex than I would have liked, so I wasn't able to logically think of all the possibilities in the beginning. Besides that, the other problems in the CodingBat lab were fairly straightforward. I like Boolean a little more than the the other subjects we've been studying so far.

Tuesday, October 9, 2012

Boolean

This past week, we started learning about if statements. The lab was pretty straightforward, as it was like a combination of all the lessons we had learned previously. In other words, we had to integrate our "if" knowledge into previous lessons such as the material on constructors and methods. The most confusing part was running the statements in InOrderRunner because we had to call different methods in order to get the whole thing to work. The most trouble I had was remembering to create a new MWeiInOrder, because MWeiInOrder was just the "template." After I figured that out, everything else seemed to fall into place. I think that the //comments were really helpful, and I think these should be included on future labs because it really helps us understand what to do next. I don't always remember the order of the constructors/methods so comments are really good guidelines for labs. Lastly, I had to change the instance variables from private to public because I couldn't access them from MWeiInOrder if they were private. That was kind of puzzling because I couldn't remember how I could access private instance variables. All in all, I think the labs are starting to get easier as I accumulate more knowledge on these different topics we cover in class.

Sunday, September 30, 2012

Book/BookRunner

This past week, we started a lab called Book/BookRunner, where we created different constructors and utilized different methods. We created a default constructor, an initialization constructor, modifier method, accessor method, toString() method, etc. Until about 75% of the way through the lab, it finally dawned upon me that the setbookName() method meant to set the name of the book to a new name. Oh, so the names of the methods actually do mean something! While I admit it was a rather slow epiphany, it made things easier as I started to work on BookRunner and as I utilized all the methods to do what I wanted. Also, I liked the fact that I could combine System.out.println() with an object and another method. For instance, I could say System.out.println(textbook.getbookName()); and it's interesting how it can do everything at once in the same line of code. Another thing that I found interesting was the fact that I could dictate which constructor I would use based on setting the parameters in BookRunner. For instance, if I wanted to call the initialization constructor, I just had to set two arguments in the parameters: a book name and a book ISBN number. Likewise, if I just left it as an empty set, I would call the default constructor. After doing these things, it helped me realize the purpose of creating those constructors in the first place. In the beginning, I had no idea what a constructor was or what it did, so I struggled a bit in understanding what was going on. The same applies to the methods, such as toString(), because I simply didn't know what it did. I like the whole idea of trial and error in a lab like this, but often it depends on the type of lab we're doing. Certain labs need more examples while others simply need to be tried and done.

Sunday, September 23, 2012

Turtle

The most exciting thing that we did in Comp Sci this week was the Turtle lab, where we had to make the given turtle do various things through programming. The whole process became significantly easier this week for some reason, and I think that I'm starting to get the hang of it. Assigning one turtle to a preexisting one was perhaps the most difficult to wrap my head around, but I looked back to the power-point presentation and eventually remembered that two references can point to the same thing. The act of doing the lab really helps because, if we missed something during the presentation, we can always look back to it and then apply the rules to our work.
Secondly, creating methods was really interesting to me because I could simply make a turtle draw a square without having to retype everything at once. It's almost like a shortcut, and I luckily didn't seem to have any problems with that. All in all, I never expected to be able to create something in Java other than text (although technically, I didn't actually program the Turtle files beforehand). I was surprised that I was able to do something of this magnitude within the first six weeks of school. I think as we move through other topics, I am able to fully grasp concepts that we have covered in the past. For instance, a few weeks back, I didn't fully understand the purpose of a method, but I understand it a little better now. The most important thing to do (for me) is to make sure that I know what I want to accomplish, the steps to accomplish the task, and what coding couples with those steps. Starting a program is always the hardest for me, but hopefully that will change as the course continues.

Sunday, September 16, 2012

Strings

Strings seem to be one of the most frightening concepts in CS (according to my peers), and I kind of agree and disagree. Over the weekend, as I attempted to finish all of the CodingBat exercises, strings proved to be nothing short of complicated and confusing. However, the one thing I love about CodingBat is that it tells you when you have an error and WHY. Furthermore, when you run your program, it shows you which tests work and which ones don't, allowing you to decipher what was wrong in the first place. After hours of banging my head against the wall, I finally decided to surf the web to find out exactly how strings work. Strings are sort of like those magnets that you can attach and rearrange into different forms. I read about substrings and string lengths and tried them out on CodingBat. Learning and then applying was kind of like a trial-and-error process, because I simply didn't know how to dissect a string and rearrange it. Luckily, as I tried and failed, I learned from my mistakes and I was able to get through each exercise, one at a time. The whole process, albeit more than a little frustrating, was a great learning experience for me. I learned that you're not always going to get everything the first time, and that it's always good to go the extra mile by taking an interest in the subjects that you're learning as opposed to just memorizing little tidbits of information. While the concepts may be difficult to comprehend at first, once you let the knowledge sink in, the whole subject turns out to be quite fascinating. During class, I always find it a bit intimidating when my classmates know exactly what to do instantaneously, while I struggle just knowing where to START. A lot of people in CS seem to already have a background in programming Java, Python, etc. while I had no idea what I was getting into in the first place. Anyway, I'm super grateful that we are using CodingBat, because I believe that practice is key to succeeding in this class. I just have to keep working at it. Java may seem frustrating and tedious at first, but in the end, the reward is more than satisfactory.

Sunday, September 9, 2012

The first week of AP Computer Science was one of the most nerve-wracking and exciting classes of the week. Somehow, I pulled through. Because I don't have a background in CS, I was thoroughly confused with Java syntax. I was told that Java syntax is more confusing than most of the other CS languages out there, and I can see why. On Friday, we programmed 4 different programs in order to learn data types, variables, and input. Here are the steps to create such a program:

1) import java.util.Scanner; // This imports Scanner

2) public class ______ (topic... Ex: Age) // This is the class

3) {

4) public static void main(String args[]); // This is within the class

5) {

6) int _____; // This will be your first variable (Ex: years), put all variables at beginning

7) Scanner scan = new Scanner(System.in); // This creates a new Scanner object

8) System.out.println("_______?"); // Type something directing user to input a value

9) years = scan.nextInt(); // Scanner brings in an int value

10) years = years*2; // Type your function or calculation here

11) System.out.print("Your age doubled is "); // You will see this before the number that gets calculated

12) System.out.println(years); // This shows the calculated number

13) }

14) } 


Depending on what program you want to create, the calculations and variables will vary. This was complicated for me because we basically flipped through the slides very fast and I couldn't exactly comprehend or absorb any of the information. Until I actually did it, I didn't know where to start, and maybe if there was more clarification on what each line actually DOES, I would catch on quicker. Java syntax is so confusing to me, so it will probably be helpful for the present and future if the function of each line was explained in more detail. Otherwise, programming is really fun once you actually get it to work. CS turned out to be more fun than I anticipated.