Wednesday, December 5, 2007

AP practice tests for CS

Had two tests this week. The one yesterday was a 40 question multiple choice in which we were required to answer 30. A majority of them dealt with classes, which is a JAVA concept I have been wrapping my head around the past few months (the concept finally clicked when some classmates showed me a few things). Actually the concept of classes was something I had in my mind before I knew how to go about programming in such a manner (You develop a very ambitious project and you begin to realize very quick that its not just a quick and dirty application).

The second portion of the practice test was a free-response question. The first involved the simulation of a parking garage, and I had to write code for three different parts.

The first part was to find out if the parking garage is full. This was simple enough. Check each level and if a level isn't full, then the garage isn't full.

The second part was to place a car in the next available space in the garage, and the third part was to remove a car. Since the value of "null" represented an empty space, it was just a matter of finding this empty spot and placing the car there. The third part was also quite similar, but a little different because it involved comparisons between two strings (sentences) and I'm not sure if I got it right. The problem is I'm not too keen on how objects work (something I need to practice on if I am to do good on the real thing).

Unfortunately, this took me around an hour to code. The one disadvantage with AP testing is that I don't have the compiler on hand to trace through code. I'm not talking about the debugger, but actually running the program and seeing where it goes as opposed to where I think it might go.

The second problem involved HTML processing. Since strings can't be deleted (for whatever reason), I got stuck on the whole "remove things from a string" idea. The ironic thing is I could have completed this easily if I would have realized that the second and third problems were really just variations of the first one.

Oh well. Chalk it up to learning lesson 2 about AP style testing :)

I can't wait until Christmas break. Two weeks of sheer, no-school bliss!

No comments: