*** Official AP Computer Science A Thread 2013-2014 ***

<p>@Fantasysia‌ I think they wanted it to be applicable to any situation. That chart was just an example of what would happen.</p>

<p>@Fantasysia AFAIK, they will not penalize you for using parts of the Java language outside of the AP subset.</p>

<p>I did that in one instance, but tried to limit it, because you’re risking the grader not knowing the language outside of the subset (think about it - would you trust every AP Comp Sci teacher to know the full language? I wouldn’t).</p>

<p>Since charAt() is a fairly common method, though, you should be fine.</p>

<p>I think I did a nested if loop where the first layer was “if (word.substring(i,i+1).equals(“A”))” and the next layer was “if word.substring(i+1, i+2).compareTo(“A”!=0))”</p>

<p>Anybody know around when they’ll post FRQs tomorrow? Really itching to share some of my solutions to some of them… Had a really neat solution to the last FRQ.</p>

<p>@terrapin45 It should be around 4:00pm. They posted the AP Chemistry ones at right around 3:40 today. 4 is their normal time.</p>

<p>Gotta be careful with charAt(): note that it returns a char value, not a String …</p>

<p>Just a reminder:
“The College Board will automatically cancel your exam score if you are discovered disclosing:
● multiple-choice questions;
● free-response questions from an alternate exam;
● free-response questions from a regularly scheduled exam within two days of its administration; or
● free-response questions that are not released on the College Board website two days after the regularly
scheduled exam administration.
This means that something you may not have intended as a violation, like casually talking about a
multiple-choice question with your friends or your teacher during the exam break, or discussing a
free-response online right after the exam, can actually result in having your score canceled.
You can only discuss free-response questions from a regularly scheduled exam after two days have
passed, and if that particular free-response question was released on the College Board website.”</p>

<p>They usually release the questions at 4:00 pm two days after the test.</p>

<p>nvrmind</p>

<p><a href=“http://media.collegeboard.com/digitalServices/pdf/ap/ap14_frq_computer_science_a.pdf”>http://media.collegeboard.com/digitalServices/pdf/ap/ap14_frq_computer_science_a.pdf&lt;/a&gt;&lt;/p&gt;

<p>FRQ’s are up</p>

<p>It’s about time!</p>

<p>So who else tested what they did as soon as they got home? I had all of my code running in Eclipse within an hour.</p>

<p>1A was pretty simple… I just went letter by letter, and did a continue; statement if either the current letter was not “A”, or the next letter and current letter were both “A”… Swapping was just some substring work.</p>

<p>For 1B I just ran through each word and compared the strings of result + current… If it changed, added it to a new List, and then merged the two lists.</p>

<p>2A was so incredibly simple… We just had to override the Director() constructor and act() method, right? Didn’t seem like anything else was needed (Though I really only read through GridWorld a few times).</p>

<p>3A -> This seemed fairly straight forward… Create a new array of arrays, and then iterate over each col/row, adding the next student each time… Used an incrementer variable (which I don’t like), but I didn’t want to be complex.</p>

<p>3B -> I mean it was a pretty straightforward question? Just went through each and set the seat to null if they exceeded absences?</p>

<p>4A -> The constructor was super easy, as was the getName() part. The only real (not really) difficult part (if you could say that) was figuring out a fun way to calculate the price. I just did the obvious lowestPrice var, and used a ternary operator to assign it the lowest variable. Then did sandwich.getPrice() + side.getPrice() + drink.getPrice() - lowestPrice;</p>

<p>@terrapin45 Haven’t tested my code yet, didn’t really remember much of the questions right away. I might type it all up later. 2 was incredibly simple, nearly every line of code could have been copied from other GridWorld classes, and only from the ones that they gave you the code for. It wasn’t “override Director” though; Director didn’t exist. That’s what you were creating. Extend Rock, copy the processActors and getActors methods, modify processActors to check for this.getColor(Color.GREEN), then iterate through the list using for(Actor a : actors) { a.setDirection(a.getDirection() + Location.RIGHT); }. And of course change the color using a simple if else every time act() is called, at the end of the method.</p>

<p>@MoonMax It didn’t say that the corresponding actors had to be Green. It only said that the Director had to be Green.</p>

<p>@moonmax Sorry, poor wording on my part, regarding “overriding Director”… I should have said override the default constructor, but was in a rush to get my thoughts down. </p>

<p>I didn’t modify processActors/getActors O_O. I just used the getNeighbors() method in Grid/Location (I forget which has it), as the method’s description claimed to return all adjacent actors… Then I went through each actor and rotated. Was I supposed to override processActors/getActors? It did say to override all methods that need to… Though, I assumed I didn’t have to because Rock didn’t, itself.</p>

<p>@terrapin45 I said “this.getColor()”, which would have gotten the DIRECTOR’s color. Also, processActors and getActors were methods that were created on the level of ChameleonCritter. I was just pointing out that the easiest way to do that was to copy the methods, word for word, from the provided source code for ChameleonCritter. It basically does exactly what you did. </p>

<p>@MoonMax Ah, good to know. I self-studied for the test, and thus spent about an hour total on GridWorld… Basically just enough to get me going for practice tests, so wasn’t sure of all of the ins and outs of the rules for the study.</p>

<p>@terrapin45 That would be more than the zero minutes I spent on GridWorld. I came in cold, zero studying, and only had a very vague understanding of GridWorld from doing a multiple choice assignment that I received in class.</p>

<p>processActors() belongs to the Critter class and its subclasses. You should only have needed to override the act() method of the Rock class you were extending.</p>

<p>@jkhuggins If you would have properly read what I said, I copied the method header processActors() and body for getActors() from this, just as any old idiot could have done on the test. I did NOT override them, considering they didn’t exist in the Rock. The GridWorld question was too easy.</p>

<p>For the first FRQ, I misunderstood what the question was asking. I thought when it said “two letters containing an A and a letter that is not A” I thought I meant something like “AAB” not something like “AB.” If you read the way they actually wrote it on the test, it’s understandable to interpret it the way I did. Anyway, my program was very complex because of the way I misinterpreted the question. How many points do you think I will lose for doing this?</p>

<p>@student0011 It’s impossible to tell without knowing the scoring guidelines, but… I’d imagine you’ll get some points here and there for accomplishing parts of it (I’d guess there’ll be a point for going letter by letter, a point for switching letters, etc).</p>