2010 AP Computer Science Discussion

<p>^ That will not be on the test (Big O I mean)</p>

<p>we can use things like the Random class instead of Math.random(), correct?</p>

<p>@phxfire he/she asked, so I answered :P</p>

<p>good website for insertion sort: [Insertion</a> sort](<a href=“http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/insert/insertionen.htm]Insertion”>http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/insert/insertionen.htm)</p>

<p>Yes you can use random class but you will probably have to define it first…</p>

<p>do we have to import it? it’s in java.util. so is it automatically imported?</p>

<p>

Heh. I started one at my school, you should too! We’ve actually won a contract to build some software for our school.</p>

<p>No points off if you rewrite the header, also there shouldn’t be any points off for omitting the braces on accident as long as you use some somewhere along the way (same for semicolons). I had a list of errors they can’t take off for but I can’t find it. Also, remember to indent, so even if you forget to add braces they’ll know what you are talking about (this is coming from an AP grader so I’m pretty sure its accurate). </p>

<p>No I don’t think you have to import it.</p>

<p>anyone have the answers to the 2009 released test?</p>

<p>^ ^ anyone have the 2009 test? more like</p>

<p>@ iambenk</p>

<p>No I don’t think you have to write it unless it is a class declaration, if you have to write methods do not worry about it.</p>

<p>I would write it in the class declaration just for good measure, it will only take you 1 second.</p>

<p>It’s copyrighted, so unless they have it hard copy, I don’t think they can post it generally.</p>

<p>On the FRQs, how hard are they on grading mistakes that would easily be caught by the compiler?</p>

<p>Like if I forgot to return at the end of a method, or I forgot the () in bob.eatPizza(). Those are the only sort of mistakes I’m making on practice tests. The logic of the FRQs seems pretty easy.</p>

<p>2009 test would be great.</p>

<p>^^ nooo! the frqs are so hard!</p>

<p>Anyone else do the FRQs in Barron’s and find them much easier?</p>

<p>They grade FRQ like many other exams.
If you are missing something in you code such as a return statement you will probably get points taken off, you will probably have time left over after the test, use this time to make sure you included these type of things.</p>

<p>Oh, and for the guy who asked for the difference between abstract classes and interfaces. Just a couple of differences:</p>

<p>Abstract classes can have non-abstract methods. All methods in interfaces are public abstract.</p>

<p>A class can implement multiple interfaces. public Class NewClass extends OldClass implements interface1, interface 2, interface 3; But a class can only extend one abstract class (or any class for that matter).</p>

<p>Anyone have tips on quickly going through a bunch of if loops or confusing recursion methods?</p>

<p>try a couple easy values and see if you can see a pattern. if not…just do them?</p>

<p>I try to keep myself honest with brackets and make sure that I am looping everything properly. This gets especially tricky with nested for loops.</p>

<p>Here’s a good recursion question to practice:</p>

<p>public static int mystery(int a, int b)
{
if (b == 0)
return -5 * a;
return mystery(a+5, b-1);
}</p>

<p>What does a call to mystery(5,4) return? Don’t put it into TextPad. :)</p>

<p>I’ll tell you if your answer is right or not.</p>