@jkhuggins Basically I cast the NumberGroup object into a Range and then had getter methods to get the min and max of each range. I essentially did the contains method over again.
if (num>=range.getMin() && num<=range.getMin()) …
that’s basically what I did.
Like if I get 1 point for the other parts of this question, do I get 1 point overall or do I get 0 points bc I used extraneous code that could’ve been simplified.
if u did Range lol = groupList.get(index); thats wrong right
I did Range lol = (Range)groupList.get(index)
I tried it and it works.
Interfaces can’t have instance variables
How are you going to access those instance variables? If you just did private int[] and just left it there then it should be fine.
@rdeng2614 @darkpoison Casting a NumberGroup to a Range only works if the object was originally a Range. There’s nothing to say that there couldn’t be other kinds of NumberGroup objects that don’t look like Ranges. So anything that relies on casting back to Range is going to be a significant problem.
@ypmagic Okay, so after digging into Java a bit … defining variables in an interface is allowed, but they become “public static final” by default. That is, any variable you define in an interface is immediately a constant. So, there’s probably no deduction in part A (extraneous code that causes no side effect). However, there’s now a serious problem with part B (since you can’t modify that array) and part C (because it sounds like you didn’t call the contains() method from part B). I’m guessing that’s 2-3 points off overall, but I’m just guessing here.
I have seen a few solutions for Range (#4, part b) that use a min/max private variable method to design the class.
I created a private int array and made a proper constructor and contains method. Would this probably be acceptable?
@CounterStruck I expect we’ll see that approach quite frequently. If it works properly, it should be eligible for full credit (even if it is less efficient).
@jkhuggins Thanks. I was a bit worried
I think I missed the entire part C, hopefully that’s the only major thing I missed on the FRQ.
What’s the curve on this?
frq questions => https://secure-media.collegeboard.org/digitalServices/pdf/ap/ap15_frq_computer_science_a.pdf
frq answers => https://apcomputersciencetutoring.com/exam-review/
score calculator => http://appass.com/calculators/computerscience
@ypmagic Implementing an interface isn’t a method override. So, yes, in part ©, the method you’re writing for the MultipleGroups class has to call the contains() method on all the NumberGroup objects in the list. You can’t assume that the items in the list are Ranges; all you know is that they’re NumberGroups.
If instead of using the “contains” method for the last part of 4 and instead tried to access the getMin and getMax through public accessor methods in the Range class, how many points do you think I will lose?
Lol that’s the exact same thing I did. Hopefully we’ll get at least one point.
I think I can we can at least get 1-1.5 points for using a for loop and returning true/false.
I just don’t know if you actually get docked points for writing extraneous code that could be replaced or do you just not get any points.
@ayraify That’s a serious problem; as @rdeng2614 suggests, you may get points for the loop and the return, but you’ll lose points for making the correct determination. That could be 1-2 points, depending on how the rubric falls.
@jkhuggins How many points, based off of previous exams, do you think would be taken off for forgetting the parameter in the method “public boolean contains(int x)” in 4a assuming that the rest of the code is correct?
Another professional review of the questions: http://www.apluscompsci.com/ap_computer_science_free_response.html
Oh ok, that’s great then. I wasn’t expecting much, just hoping to not get negative points.
@FlamDragz Probably one point. (Most deductions are 1 point; if you look at past rubrics, we find a way to divide the 9 possible points among different aspects of the problem. Simple omissions typically only affect one point in the rubric; more fundamental errors can have wider impact.)
@rdeng2614 It’s not possible to earn negative points in any given part. We never want to get to the point that someone who wrote something scores worse than someone who wrote nothing.
I am not sure what is the average scores students tend to earn on these…but they should be around 4-5. Keeping that in mind, if you were to get 20 points on the frq and about 60 percent on the Mc, your chances of getting a 4 would be much higher!