*** OFFICIAL 2013 AP Computer Science A Thread***

<p>i seem to do better when i concentrate however so that should be good</p>

<p>@ccuser:
The only sorts tested on the AP exam are:

  • Selection
  • Insertion
  • Mergesort</p>

<p>@tbradsworth yea and the two searches: linear and binary</p>

<p>i would really like to try to take the 2009 multiple choice today</p>

<p>@Lightens
Is linear = sequential search?</p>

<ol>
<li>Can we do Subclass x = new Subclass(); Or is that wrong, because right now, my memory is failing me.</li>
<li>If no default constructor is specified, and you call a constructor with no parameters in the client program, does that cause an error (run-time or watev) ?? </li>
<li>Does anyone know when downcasting is unnecessary?</li>
</ol>

<ol>
<li>What exactly does “this” refer to?? The method it’s used in, or the entire class, or if in the subclass, the entire subclass??</li>
</ol>

<p>Is it true that the late ap exams are harder than the regular ones? Are the curves different? If they are, how different?</p>

<p>@ccuser:
Yes, linear search is sequential search (brute force check)</p>

<ol>
<li>Yes, you can do that. Think of the subclass just like any ordinary class.</li>
<li>If a class has no specified destructor, call the empty constructor(new Class())</li>
<li>Can you be a bit more clear?</li>
<li>this refers to the current instance of the class. You can think of this like any ordinary instance of the class (i.e. Foo this = new Foo(); // do whatever you want with this that you can do with Foo). The only difference is that you can access private functions in the subclass and protected functions in the superclass.</li>
</ol>

<p>Hi-</p>

<p>I was wondering if someone could explain to me why #36 is C, but why #18 is A? I don’t get it! :slight_smile: </p>

<p>The link below has the questions</p>

<p>[url=&lt;a href=“http://www.■■■■■■■■■■//photos/95548641@N06/sets/72157633435772946/show/]APCS[/url”&gt;APCS | Flickr]APCS[/url</a>]</p>

<p>Thanks!</p>

<p>18 is A because:

  • The variable “length” is passed by VALUE. This means that instead of passing the reference to “length” the value of “length” is copied into the parameter “n” variable. Thus, any changes to “n” do not affect “length”.
  • The reference for the variable “nums” on the other hand is passed by value. This means that if you change anything in “nums”, whatever was passed to the function for “nums” also receives the changes. However, since the reference was passed by value, if you try to change the actual reference of “nums” (i.e. nums = new double[5]), whatever was passed to the function as “nums” (in this case, “samples”) will not be affected.</p>

<p>Same reasoning applies to 36.</p>

<p>If you don’t get it, I’ll try and give you a more detailed explanation.</p>

<p>I get why length is the same…but why does the array receive changes in 18 but not 36?</p>

<p>@tbardsworth</p>

<p>I myself can’t remember the specifics of the question about downcasting. I just asked because I came across something similar, but now I can’t remember. </p>

<p>Anyways. Thanks btw for ur answers. </p>

<p>So, arrays are passed by reference. Primitive types are passed by value??
Equals(object) compares the content or the address, e.g if I compare an array element, and some other value, will I get True?? If I compare an Integer object and a value, will I get True??</p>

<p>Primitive types are passed by value.
Everything else is passed by reference.</p>

<p>equals() compares the value, while == compares the reference (unless you’re working with value types, in which it compares the value).
Object == primitive will autounbox the Object to match the primitive.
Object.equals(primitive) will autobox the primitive to match the Object.</p>

<p>Here’s a good analogy for references/values:
Think of value types as a map (not the CS map, an actual map of the world). Say I want to give you a map (consider this to be passing a parameter). To do that, I photocopy the map and give you an actual separate map. They have the same content, but if you scribble on your map, my map doesn’t get scribbles.</p>

<p>Now, think of reference types are URLs. Say I have a website that has a picture of a world map. I give the URL to you (passing a reference to a function). If you change the contents of the webpage/the image of the map, I see the changes too, because we both just have a <em>reference</em> to the map, instead of an actual copy of the map.</p>

<p>So I took both Barron’s practice exam and the 2008 collegeboard practice exam and realized that the two was really different in nature. Barron’s had a lot more concept put into it while the collegeboard one seemed to go into more of programming and nothing practically on concept. I know they did remake the test for 2011, do you guys know how the recent tests are going to be like?</p>

<p>Random Question: Does a BoxBug leave a flower behind?</p>

<p>Anybody else here aiming for a 5 but doesn’t know what the best way to cram for this is? Do you think just doing practice tests and reviewing concepts based on questions I get wrong is the best way? Or just re-reading full chapters from the Barron’s/Litvin’s book?</p>

<p>@ccuser001 yes, a boxbug leaves a flower behind
Also, does anyone have a pdf copy of the 2008 ap comp sci exam?</p>

<p>Which of the following tasks is made easier when information hiding is practiced?
I. Implementing IS-A relationships for a class
II. Making changes to implementation of one of the classes in a project
III. Producing specifications for programmers working on the same project</p>

<p>HELP?! Can someone please explain why it’s II and III? I understand why its III, just not II.</p>

<p>Thanks!</p>

<p>can someone please pm me the 2009 test please!!! or post a temporary link?</p>

<p>this is problem 24 from 2009 test. i cant understand why the answer is D.</p>

<p>[url=&lt;a href=“http://■■■■■■■.com/r/ea5der/5]link[/url”&gt;http://■■■■■■■.com/r/ea5der/5]link[/url</a>]</p>

<p>thanks</p>

<p>EDIT: sorry guys I thought it was 2009 but its really 2008 one! sorry!!!</p>