2010 AP Computer Science Discussion

<p>Do you * really* need all of them?</p>

<p>Anyone here use gmail?</p>

<p>I hate tests with high curves…Bad for people who know the stuff but make careless errors lol</p>

<p>Meadow, I would really appreciate it. :-)</p>

<p>PM me your email.</p>

<p>Yeah for the gridworld part b, I used getOccupiedAdjacentLocations() to get the ones initially around it. Then I made an array of the locations at the four corners around the initial and used a system of three for-each loops to get their getOccupiedAdjacentLocations() and then check to see if they are not part of the main array list(with the first set of locs), and to make sure they are not the location passed in as the parameter. If both condiditons were true, the location would be added to the main array list. This was looped for all four corners. This should have left the main array list with all corresponding points. But yeah I should have made sure that (new Location(col-1, row-1)) or whatever were valid…ugh…oh well…a few points lost…bleh</p>

<p>Junhugie, I completely agree! I do well with tests like AP Physics C and Calc BC, because I really know the material but might make a stupid mistake.</p>

<p>For example on one of the FRQ’s I was going to use a while loop for something, but I wanted to write the interior first while it was fresh in my mind. Totally forgot to write the while loop until 10 minutes before it ended (I did a preliminary check of my answers for any errors that were grammatical or omissions of “;”, and then another check to make sure they were functional.)</p>

<p>It scared me because I had to literally shift my entire method down by two lines, so I erased everything hoping time wouldn’t run out while erasing.</p>

<p>For the earlier ones I used a plethora of for-each loops, even a nested for-each loop for 4.a</p>

<p>Did anyone else approach 4a in a similar manner?</p>

<p>I did a for each loop on each actor on the grid and then a for each loop for each element in the getNeighbors ArrayList.</p>

<p>4b was just going through a nested for loop row - 2 to row + 2 and col -2 to col +2, skipping row,col.</p>

<p>I thought it was much easier than what I expected, and definitely easier than the exams I had this summer.</p>

<p>I didn’t skip any MC, but I think that I might have missed a few.</p>

<p>Yeah Ramblinman, I did 4a somewhat like yours.</p>

<p>Anyone want to send me the solutions?</p>

<p>To answer some of the questions that have floated by …</p>

<p>“Official” solutions, along with the grading guidelines, won’t be posted for some time … late summer or early fall. Everything tends to get posted at once: grading guidelines, sample solutions from students, commentary on how those solutions were graded, commentary on the problem as a whole, and so on. Since the problems won’t be graded until mid-June, and it takes time to clean up the paperwork and put it all together.</p>

<p>Of course, that doesn’t stop y’all from working out the answers yourselves, perhaps with your instructors. I’m sure there will be some samples posted on other websites.</p>

<p>As to how common a perfect score on the FRQs is: I’m not sure. An individual perfect score can vary from 1-10% of all exams, depending on how hard the problem is. My guess is that a perfect set of four is pretty rare … it’s easy to overlook one small detail on one problem and end up getting an 8 instead of a 9.</p>

<p>And nobody really knows how the curve will be until after the grading is done. The curve gets set after all the scores are in, and the difficulty of this year’s problems can be compared with previous year’s problems.</p>

<p>I’m reasonably confident that all my solutions are correct, except for a minor error I made on #3a. If anyone wants my solutions I’ll be happy to PM you.</p>

<p>We had done something similar to #4b in class several times. My solution was:

  • set up a nested for loop, looping from getRow()-2 to getRow()+2 (same for getCol)
  • create a Location called “temp” with the coordinates
  • check if temp is valid AND temp is not equal to loc
  • if gr.get(temp) is not null, add temp to list of locations to be returned</p>

<p>My gridworld solution:</p>

<p>Get all the actors in the grid. easy checking there.
Use double for loops to check whether they are 2 columns and rows near the said point.
Remove one if one actor is on the same location as said point.
If there are no actors, nothing will add, and 0 will be sent.</p>

<p>[it has been 48 hours, or I am crazy)</p>

<p>Can we discuss the multiple choice now?!</p>

<p>No. Never.</p>

<p>Gridworld part B basic solution:</p>

<p>Loop through all adjacent locations of your adjacent locations.
Check if they’re valid (you can use getValidAdjacentLocations() or whatever) and not equal to current location
Check to see if != null (tells you if an actor is at that location)
That’s it. </p>

<p>Also, remember if you have to remove() an actor, you must decrement your loop count to account for the shifting of the ArrayList, but you do not need to do anything to ArrayList.size().</p>

<p>For 4b A For-Each loop may not have been effective. If you start by getting all the adjacent locations and you use the remove() method of an arraylist, the for each wouldn’t work out too well. You could still do it that way though, just might take more code or require a different starting approach. Anyone agree that a common for loop would be better?</p>

<p>nigcrunch: How would you know if you haven’t already checked a spot?</p>

<p>And wouldn’t removing the actor take it out of the grid?</p>

<p>No i mean like removing an unoccupied location from an arrayList of all the locations 2 spots of way. </p>

<p>You can run a loop to check for duplicate locations as in the following:</p>

<p>for(int i=0;i<a.size()-1;i++){
for(int j=i+1;j<a.size();j++){
if(a.get(j)==a.get(i)){
a.remove(j);
j–;
}
}
}</p>

<p>What was the question in 4a? I forget lol</p>

<p>

</p>

<p>It’s not a matter of working better, it wouldn’t work at all. You aren’t allowed to do anything that would change the size of a list inside of a for-each loop; it just throws an exception.</p>